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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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,223,953
Messages
6,175,598
Members
452,658
Latest member
GStorm

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