VBA File Save As Error

Michael Fowler

New Member
Joined
Jan 23, 2024
Messages
28
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
Hi everyone. I'm getting a debug error on the last line of the following code when the macro is run. And there is a valid value in cell J1. Can you help as to what the error is ?

Path = "C:\Data\Clients\Certifications\"
FileName = Range("J1").Value
ActiveWorkbook.SaveAs Path & FileName & ".xlsx"
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
What is the debug message?
What's the value in J1?
 
Upvote 0
What is the debug message?
What's the value in J1?
Run-time error 1004 : This extension cannot be used with the selected file type. (Note : It's not working whether I use xlsx or xlsm.)
The value in J1 is just a string of "Certification " and the date.
 
Upvote 0
Run-time error 1004 : This extension cannot be used with the selected file type. (Note : It's not working whether I use xlsx or xlsm.)
The value in J1 is just a string of "Certification " and the date.
It's okay, I got it. My string had slashes instead of underscores in the date. have fixed now. Thanks.
 
Upvote 0
Solution

Forum statistics

Threads
1,216,175
Messages
6,129,305
Members
449,499
Latest member
HockeyBoi

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