BarefootPaul
Board Regular
- Joined
- Jul 21, 2011
- Messages
- 54
I wrote this code to populate a cell in the file and then save it to a location on a shared folder on the server. When it runs it fails to save it at all.
I have read http://www.rondebruin.nl/saveas.htm and tried using FileFormat = 52, but get the same error.
Any help would be greatly appreciated. I am new to this and welcome any and all feedback.
Thanks
PHP:
Private Sub BtnOK_Click()
ActiveWorkbook.Sheets("Info").Activate
Range("A3").Select
If IsEmpty(TxtCredentials.Value) = True Then
ActiveCell.Value = TxtFName.Value & " " & TxtLName.Value
ElseIf IsEmpty(TxtCredentials.Value) = False Then
ActiveCell.Value = TxtFName.Value & " " & TxtLName.Value & ", " & TxtCredentials.Value
End If
Dim MyName As String
Dim MyPath As String
MyName = TxtFName.Value & " " & TxtLName.Value & " TCM Billing Log 2011.xlsm"
MyPath = "I:\Forms\Billing\Users\" & TxtEmail.Value & "\"
ActiveWorkbook.SaveAs Filename = MyPath & MyName, FileFormat = xlOpenXMLWorkbookMacroEnabled
MsgBox ("Your Billing Log has been saved to the shared drive at I:\Forms\Billing\Users\" & TxtEmail & "\ as" & TxtFName.Value & " " & TxtLName.Value & " TCM Billing Log 2011.xlsm.")
End Sub
I have read http://www.rondebruin.nl/saveas.htm and tried using FileFormat = 52, but get the same error.
Any help would be greatly appreciated. I am new to this and welcome any and all feedback.
Thanks