VBA Extension Error when SavingAs .CSV

PartTimeExcel

New Member
Joined
Dec 9, 2020
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm trying to SaveAs in VBA and make an .CSV file. When I do, I'm getting it to save in the correct path, but with an extension of ".21" (because of the date element?) My code is below. Any ideas?? Thanks!

ActiveWorkbook.SaveAs "\\server\2021 Imports\PP Import " & Format(Now, "mm.dd.yy") _
, FileFormat:=xlCSV, CreateBackup:=False
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How about
VBA Code:
ActiveWorkbook.SaveAs "\\server\2021 Imports\PP Import " & Format(Now, "mm.dd.yy") & ".csv" _
        , FileFormat:=xlCSV, CreateBackup:=False
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,563
Messages
6,114,329
Members
448,564
Latest member
ED38

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