Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Format() doesn't work from a Form

I have two add-ins that I created for excel 2000. Each add-in uses the
format function to reformat dates, etc. The module from add-in #1 is now
giving me this error:

"Wrong number of arguments or invalid property assignment."

Here is my code that I am running on each module:

sub test()
msgbox format(cdate(date),"mm-dddd-yy")
end sub

(the actual code I'm running is obviously more involved, this is just a test
macro)

On the module for add-in #2 it runs fine, on the other I recieve the error
message. I'm sure it's a simple thing I've overlooked but I'm unable to find
it. I clicked on "Tools" and "References" and they both have the same
references checked off. I'm at a loss.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Format() doesn't work from a Form

Hi,

It's possible there is a Subroutine or Function with the same name as a
built in one but with different arguments or return variable.


Cheers
Andy

Chad wrote:

I have two add-ins that I created for excel 2000. Each add-in uses the
format function to reformat dates, etc. The module from add-in #1 is now
giving me this error:

"Wrong number of arguments or invalid property assignment."

Here is my code that I am running on each module:

sub test()
msgbox format(cdate(date),"mm-dddd-yy")
end sub

(the actual code I'm running is obviously more involved, this is just a test
macro)

On the module for add-in #2 it runs fine, on the other I recieve the error
message. I'm sure it's a simple thing I've overlooked but I'm unable to find
it. I clicked on "Tools" and "References" and they both have the same
references checked off. I'm at a loss.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Format() doesn't work from a Form

I know this is not it, but you do realize that you have 4 positions
for the day section.
msgbox format(cdate(date),"mm-DDDD-yy")
This would give the error you are recieving.
On Wed, 10 Nov 2004 17:29:04 -0800, "Chad"
wrote:

I have two add-ins that I created for excel 2000. Each add-in uses the
format function to reformat dates, etc. The module from add-in #1 is now
giving me this error:

"Wrong number of arguments or invalid property assignment."

Here is my code that I am running on each module:

sub test()
msgbox format(cdate(date),"mm-dddd-yy")
end sub

(the actual code I'm running is obviously more involved, this is just a test
macro)

On the module for add-in #2 it runs fine, on the other I recieve the error
message. I'm sure it's a simple thing I've overlooked but I'm unable to find
it. I clicked on "Tools" and "References" and they both have the same
references checked off. I'm at a loss.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Format() doesn't work from a Form

Hi CDrews,

For me that date format returns 11-Thursday-04

And according to the help file you can use up to six d's.

<help
d Display the day as a number without a leading zero (1 – 31).
dd Display the day as a number with a leading zero (01 – 31).
ddd Display the day as an abbreviation (Sun – Sat).
dddd Display the day as a full name (Sunday – Saturday).
ddddd Display the date as a complete date (including day, month, and
year), formatted according to your system's short date format setting.
The default short date format is m/d/yy.
dddddd Display a date serial number as a complete date (including day,
month, and year) formatted according to the long date setting recognized
by your system. The default long date format is mmmm dd, yyyy.
</help

Cheers
Andy

CDrews wrote:

I know this is not it, but you do realize that you have 4 positions
for the day section.
msgbox format(cdate(date),"mm-DDDD-yy")
This would give the error you are recieving.
On Wed, 10 Nov 2004 17:29:04 -0800, "Chad"
wrote:


I have two add-ins that I created for excel 2000. Each add-in uses the
format function to reformat dates, etc. The module from add-in #1 is now
giving me this error:

"Wrong number of arguments or invalid property assignment."

Here is my code that I am running on each module:

sub test()
msgbox format(cdate(date),"mm-dddd-yy")
end sub

(the actual code I'm running is obviously more involved, this is just a test
macro)

On the module for add-in #2 it runs fine, on the other I recieve the error
message. I'm sure it's a simple thing I've overlooked but I'm unable to find
it. I clicked on "Tools" and "References" and they both have the same
references checked off. I'm at a loss.




--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Format() doesn't work from a Form

Heh, I found the error shortly after posting this. It's what you said, Andy.
I had a subroutine named Format. I felt pretty dumb after I found it. :)

"Andy Pope" wrote:

Hi,

It's possible there is a Subroutine or Function with the same name as a
built in one but with different arguments or return variable.


Cheers
Andy

Chad wrote:

I have two add-ins that I created for excel 2000. Each add-in uses the
format function to reformat dates, etc. The module from add-in #1 is now
giving me this error:

"Wrong number of arguments or invalid property assignment."

Here is my code that I am running on each module:

sub test()
msgbox format(cdate(date),"mm-dddd-yy")
end sub

(the actual code I'm running is obviously more involved, this is just a test
macro)

On the module for add-in #2 it runs fine, on the other I recieve the error
message. I'm sure it's a simple thing I've overlooked but I'm unable to find
it. I clicked on "Tools" and "References" and they both have the same
references checked off. I'm at a loss.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro does not work if form protected Wanna Learn Excel Discussion (Misc queries) 2 August 6th 08 06:07 PM
Excel Form Format to Spreadsheet Format Karen Excel Discussion (Misc queries) 4 October 23rd 06 06:03 PM
Work Underneath a User form peekbo Excel Programming 2 May 20th 04 11:46 PM
Keep format after paste from other worksheets - conditional format or EnableControl solution doesn't work No Name Excel Programming 0 May 3rd 04 12:22 PM
Form.Refresh doesn't work...help !! Tereba[_2_] Excel Programming 2 January 31st 04 10:43 PM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"