PremSivakanthan
New Member
Hi, I'm having a problem with the following code - the getsave as method works fine, but it comes up with a runtime error, on the saveas line. I think its something to do with the Initialfilename string, but havent been able to figure it out.
Dim sFileName As String
Dim sCampaignName As String
Dim sht As Worksheet
Sub SaveCopy()
'saving a copy
sCampaignName = "Campaign Results: " & Control.Range("E3").Value & " " & Format(Now, "yy-mm-dd") & ".xls"
sFileName = Application.GetSaveAsFilename("sCampaignName", "Excel 97-2003 workbook (*.xls),*.xls", 1)
If sFileName = "False" Then Exit Sub
ActiveWorkbook.SaveAs sFileName, xlExcel8
End Sub
Dim sFileName As String
Dim sCampaignName As String
Dim sht As Worksheet
Sub SaveCopy()
'saving a copy
sCampaignName = "Campaign Results: " & Control.Range("E3").Value & " " & Format(Now, "yy-mm-dd") & ".xls"
sFileName = Application.GetSaveAsFilename("sCampaignName", "Excel 97-2003 workbook (*.xls),*.xls", 1)
If sFileName = "False" Then Exit Sub
ActiveWorkbook.SaveAs sFileName, xlExcel8
End Sub