Wrong Number or Arguments / Invalid Property Assignment error

NinaE_11

Board Regular
Joined
Aug 18, 2020
Messages
67
Office Version
  1. 2016
Platform
  1. Windows
Perhaps this is something silly I'm missing, and if any one could point it out - I'd be very grateful. I'm attempting to save a copy of worksheet, with the given file name formatting below, but I get an error on the word "Format" in the fileday row. This exact language works in another workbook I have (I copied over in it's entirety), but VBA seems to choke on the underlined word below. Any insight would be appreciated - thank you!

'Create the filename with today's date and time in the filename

filePrefix = "Taiko"

fileDay = Format(Day(Now()), "00")

fileMonth = Format(Month(Now()), "00")

fileYear = Format(Year(Now()), "0000")

filenameOutput = filePrefix & " " & fileYear & " " & fileMonth & " " & fileDay

filenameLongXLSX = Application.ActiveWorkbook.Path & "\" & filenameOutput & ".xlsx"
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
This exact language works in another workbook I have
That suggests that in the workbook where it doesn't work, you have a procedure of variable called Format.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,703
Messages
6,173,973
Members
452,540
Latest member
haasro02

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