macro to save as stopped working

jwilliams919

New Member
Joined
Aug 15, 2017
Messages
3
We have had this macro for a while now and lately I get a error on the below when running . Do you guys have any recommendations?



ActiveWorkbook.SaveAs Filename:=CompleteFilename, FileFormat _
:=xlOpenXMLWorkbookMacroEnabled, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Welcome to the forums!

What error are you receiving? When you hover over the CompleteFilename variable, what value is being returned?
 
Upvote 0
Welcome to the forums!

What error are you receiving? When you hover over the CompleteFilename variable, what value is being returned?

Its tool long of a value to read but appears to go to my shared drive the original file is in
 
Last edited by a moderator:
Upvote 0
I see i cannot delete a post lol

Sorry about the above but it shows a network drive location and i get a runtime error 1004 Method "saveAS' of object_workbook'Failed
 
Upvote 0
Run the code until you get the error, then load up the Locals Window in VBA (View>Locals Window). You should be able to find your variable in this list. In the "Value" column, you can click in here and view/copy the value out. My guess is that the code is erroring because it is either an invalid file path or it has an invalid file extension.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top