(Error 1004) Object Defined Error ...simple code

R

Robert Crandal

I have the following simple simple code:

Dim s as String

s = WeekdayName(1) ' Causes Error 1004


Why would the above call to "WeekdayName(1)" suddenly
cause an Object Defined Error?? My program has been working
nicely for awhile, but now all of a sudden it halts at the above line???
What the heck is going on???

Robert Crandal
 
O

OssieMac

Hi Robert,

It works fine for me. However, checking out Help, the first day of week
parameter is supposed to default to Sunday (or 1) as the first day of the
week but it appears to default to zero.

Tested in xl2002 and xl2007

If it has been working previously I don't suppose that s has been used
elsewhere as a constant or something. Try changing the variable name to
strDOW or something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top