Hi Excel Forum Experts,
I have found a VBA code that works but i need it altered so that when it runs, the code in the new Macro Workbook is disabled so when the new workbook is reopen next time the code does not run. So If you have filled out data in the new macro workbook i just want it to open on next open as it would get very messy if you have to keep clicking save as and override the the file you are working on and you might end up overriding the wrong file.
How do i alter this code to make sure it is disabled on new file after save.
The VBA Code i am using is the followingwhich is stored in the ThisWorkbook section
Private Sub Workbook_Open()
Dim FileSaveAsName As Variant
Dim intchoice As Integer
Static saveProcess As Boolean
Application.EnableEvents = False
ActiveWindow.ScrollRow = 1
Set FileSaveName = Application.fileDialog(msoFileDialogSaveAs)
FileSaveName.InitialFileName = ThisWorkbook.Name
FileSaveName.FilterIndex = 2 'select to save with a ".xlsm" extension
intchoice = FileSaveName.Show
If intchoice <> 0 Then
FileSaveName.Execute
End If
Application.EnableEvents = True
End Sub
TIA for any assistance
Thanks
Donald
Bookmarks