VBA - Simple save as .xls

Chanty

New Member
Joined
Sep 26, 2024
Messages
5
Office Version
  1. 365
Platform
  1. MacOS
Sorry if not listing this correctly, as not been on for a few years and my old account has gone.

Been trying to get a really simple bit of code to save the file I have to .xls format
No name or directory change, as save exactly as it is, but in .xls

Thought the following would work, but keep getting an error!

VBA Code:
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & FileName.xls
 
Yes, it is important to understand the difference between "ThisWorkbook" and "ActiveWorkbook".
You do not relate to us where the code is stored, and what workbooks you are trying to run it on (the one containing the code or a different one).
Once that was clarified, we could make edits to the original code to suit your needs.
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

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