Now Function suddenly produces error... help!

Oliver Dewar

Board Regular
Joined
Apr 17, 2011
Messages
201
Hi All.

I have macros with this line of code:

Code:
Application.Wait now + TimeValue("00:00:01")

the macros have been working perfectly for months and then suddenly I get the word 'now' highlighted and this error in vba:

Compile Error:
Expected function or variable.

What's happened and how can I fix it?

Thanks in advance.

----> extra thought:

I created a sub called "protect" and vba told me it was an ambigous name... could I have inadvertently created a sub that's the same as a system function and mixed things up, or switched off excels functions or something? (Hopefully it's simpler than that!)
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
In the VBE if you go Tools>References, do you see anything listed as MISSING? If so, uncheck these and try running again.
 
Upvote 0
Thanks for your reply... I just got it! I almost hit the nail on the head in my question... and then your answer helped.

I created a sub called 'now'! Just a testing sub... but that's what did it.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,222,384
Messages
6,165,669
Members
451,983
Latest member
Raph24

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