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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
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,215,644
Messages
6,125,993
Members
449,279
Latest member
Faraz5023

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