Run-time error 76

Galceran

Board Regular
Joined
Nov 8, 2008
Messages
177
A new macro runs to format a worksheet then SavesAs, at which point error 76 path not found appears.
Code:
ChDir "C:\Users\Arthur\My Documents\My Data Sources"
    ActiveWorkbook.SaveAs Filename:= _
        "C:\Users\Arthur\My Documents\My Data Sources\tn11_merge.xls", FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
The path is correct. I now find that another macro which saves a different filename in the same location is returning error 1004. This macro previously ran and saved correctly.
Any ideas?
Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
The syntax is correct. Same files on the PC Macro runs the same macro and saves without a problem.
 
Upvote 0
Same files on the PC Macro runs the same macro and saves without a problem

Could be that the directory has been hard harded to save to "C:\Users\Arthur\My Documents\My Data Sources" which is only applicable to the user "Arthur" i.e. someone else is running the code when it fails as they don't have the "C:\Users\Arthur\My Documents\My Data Sources" path on their machine.
 
Upvote 0

Forum statistics

Threads
1,214,638
Messages
6,120,676
Members
448,977
Latest member
moonlight6

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