ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   When Using Format(Now(), "yyyymmmddhhmm") get wrong number of arguments or invalid property assignment Error (https://www.excelbanter.com/excel-programming/376983-when-using-format-now-yyyymmmddhhmm-get-wrong-number-arguments-invalid-property-assignment-error.html)

Connie

When Using Format(Now(), "yyyymmmddhhmm") get wrong number of arguments or invalid property assignment Error
 
I am using the following code to create a file name with a date and
time stamp. I get a "wrong number of arguments or invalid property
assignment" when I run the code. For some reason the compiler doesn't
like the Format(Now(), "yyyymmmddhhmm"). Can anyone tell me why? Any
help would be appreciated!

Connie

Dim FName as String
Dim VersionNo As String

FName = "\Upload Hourly " & VersionNo & Format(Now(), "yyyymmmddhhmm")


NickHK

When Using Format(Now(), "yyyymmmddhhmm") get wrong number of arguments or invalid property assignment Error
 
Works for me :
?Format(Now(), "yyyymmmddhhmm")
2006Nov081559

Sure the error is on that part ?
What is the value of VersionNo ?

And what do you expect FName to equal ?

NickHK

"Connie" wrote in message
ups.com...
I am using the following code to create a file name with a date and
time stamp. I get a "wrong number of arguments or invalid property
assignment" when I run the code. For some reason the compiler doesn't
like the Format(Now(), "yyyymmmddhhmm"). Can anyone tell me why? Any
help would be appreciated!

Connie

Dim FName as String
Dim VersionNo As String

FName = "\Upload Hourly " & VersionNo & Format(Now(), "yyyymmmddhhmm")




Connie

When Using Format(Now(), "yyyymmmddhhmm") get wrong number of arguments or invalid property assignment Error
 
Thanks for your response, Nick. I figured out that I have a macro
named Format which was causing the inconsistency.

Thanks again.
Connie

NickHK wrote:
Works for me :
?Format(Now(), "yyyymmmddhhmm")
2006Nov081559

Sure the error is on that part ?
What is the value of VersionNo ?

And what do you expect FName to equal ?

NickHK

"Connie" wrote in message
ups.com...
I am using the following code to create a file name with a date and
time stamp. I get a "wrong number of arguments or invalid property
assignment" when I run the code. For some reason the compiler doesn't
like the Format(Now(), "yyyymmmddhhmm"). Can anyone tell me why? Any
help would be appreciated!

Connie

Dim FName as String
Dim VersionNo As String

FName = "\Upload Hourly " & VersionNo & Format(Now(), "yyyymmmddhhmm")




All times are GMT +1. The time now is 05:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com