Hi all
I've lurked this forum for a long time and found it massively useful, so first of all in my first ever post here let me just say THANK YOU for all the help you've all already given me.
I'm having some problem with some code I wrote and I just can't figure it out:
I put the debug prints in there to try and see what it was doing and I'm getting the correct values that I expect for all 3, but instead of getting the textbox saying the file has been saved I'm getting the error handling text box saying it hasn't (and no file is being saved). I don't understand how I'm getting the debug prints if it's not doing the save....
I've been trying to figure out the problem here for ages and I can't seem to find it. Getting stressed out now. Please save my laptop from being thrown out of the window....
Thanks again and also in advance for any tips
I've lurked this forum for a long time and found it massively useful, so first of all in my first ever post here let me just say THANK YOU for all the help you've all already given me.
I'm having some problem with some code I wrote and I just can't figure it out:
Code:
MsgBox "Select a folder where you wish to save the Go Live Updates report."
On Error GoTo GLUErrorHandling
Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
diaFolder.AllowMultiSelect = False
diaFolder.Title = "Select a folder to save the Go Live Updates Report"
diaFolder.Show
Debug.Print diaFolder.SelectedItems(1)
UpdateFName = "Go Live Updates Report " & Format(Date, "dd-mm-yy") & ".xlsx"
UpdateFPath = diaFolder.SelectedItems(1) & "\" & UpdateFName
Debug.Print UpdateFName
Debug.Print UpdateFPath
ActiveWorkbook.SaveAs Filename:=UpdateFPath
MsgBox "A Workbook with the filename """ & UpdateFName & """ has been saved in the specified folder"
Exit Sub
GLUErrorHandling:
MsgBox "You have not yet saved a copy of this file"
End Sub
I put the debug prints in there to try and see what it was doing and I'm getting the correct values that I expect for all 3, but instead of getting the textbox saying the file has been saved I'm getting the error handling text box saying it hasn't (and no file is being saved). I don't understand how I'm getting the debug prints if it's not doing the save....
I've been trying to figure out the problem here for ages and I can't seem to find it. Getting stressed out now. Please save my laptop from being thrown out of the window....
Thanks again and also in advance for any tips