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
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Galceran

Board Regular
Joined
Nov 8, 2008
Messages
177
The syntax is correct. Same files on the PC Macro runs the same macro and saves without a problem.
 

Trebor76

Well-known Member
Joined
Jul 23, 2007
Messages
4,714
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,321
Messages
5,600,950
Members
414,417
Latest member
Nobu

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
Top