javajoe
Board Regular
- Joined
- Nov 7, 2005
- Messages
- 78
Hey folks - I have the following code (thanks to some previous posts) but when I run this code, it runs without any errors but doesn't actually save the file in the folder I specified. The path is correct so I'm not sure what's going on. Any help would be appreciated!
<code>
Private Sub SaveOnServerButton_Click()
On Error Resume Next
Dim strInitPath As String
Dim strFileName As String
'rename file
strInitPath = "\\SERVER01\Company\eCommissions" & "\" & ActiveSheet.Name & ".xls"
strFileName = Application.GetSaveAsFilename(strInitPath, "Microsoft Excel Workbook (*.xls), *.xls")
'if cancel selected exit without saving
If strFileName = False Then Exit Sub
ActiveWorkbook.SaveAs (strFileName)
End Sub
</code>
<code>
Private Sub SaveOnServerButton_Click()
On Error Resume Next
Dim strInitPath As String
Dim strFileName As String
'rename file
strInitPath = "\\SERVER01\Company\eCommissions" & "\" & ActiveSheet.Name & ".xls"
strFileName = Application.GetSaveAsFilename(strInitPath, "Microsoft Excel Workbook (*.xls), *.xls")
'if cancel selected exit without saving
If strFileName = False Then Exit Sub
ActiveWorkbook.SaveAs (strFileName)
End Sub
</code>