sassysteph434
New Member
- Joined
- Jul 24, 2022
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Hi,
Not sure if this can be fixed.. so I have a macro that saves the file as the value in A1 then sends it as an attachment. The issue i'm having is lets say the user runs the macro, then realizes that they needed to make an adjustment before they close out of the doc.. I'm getting a runtime error message that says cannot access the doc. However, if i changed the value in a1 and ran the macro it works, and if i change it back to the value that it could not find previously it will give me the prompt that the file already exists and if id like to overwrite the doc. Is there anything i can do to get it to do that the first time around (when im getting that error message
Below is the VBA and the link to the doc.
t.xlsm?)
Any help would be greatly appreciated
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+k
'
ActiveWorkbook.SaveAs Filename:=(Range("A1").Value), FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.Dialogs(xlDialogSendMail).Show
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
End Sub
Not sure if this can be fixed.. so I have a macro that saves the file as the value in A1 then sends it as an attachment. The issue i'm having is lets say the user runs the macro, then realizes that they needed to make an adjustment before they close out of the doc.. I'm getting a runtime error message that says cannot access the doc. However, if i changed the value in a1 and ran the macro it works, and if i change it back to the value that it could not find previously it will give me the prompt that the file already exists and if id like to overwrite the doc. Is there anything i can do to get it to do that the first time around (when im getting that error message
Below is the VBA and the link to the doc.
t.xlsm?)
Any help would be greatly appreciated
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+k
'
ActiveWorkbook.SaveAs Filename:=(Range("A1").Value), FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.Dialogs(xlDialogSendMail).Show
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
End Sub