Run-time error '1004' at "Application.Calculate"

P

PCLIVE

I started getting this error a little while back.

Run-time error '1004':
Cannot run Visual Basic macro because of a syntax error.

This macro is activated by a button on my worksheet.
The first time I press it, I get the error. However, the first error does
not allow me to click "Debug".
I press the button again and the error comes up again. This time I can
click "Debug" which highlights "Application.Calculate".
I can continue running the macro code by pressing the triangle or play
button...or I can close the VB editor and click the button that calls the
macro. In either case, the macro runs through without error.

Any ideas why this error occurs at "Application.Calculate"?

Thanks,
Paul
 
P

PCLIVE

I'm not sure how much this will help, but this is it from the beginning to
where it stops.


With ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
.DeleteLines 1, .CountOfLines
End With
''''''''''''''Above code is successful

If Range("T10") = "False" Then Application.ScreenUpdating = False

NoAction:
Application.Calculate
'''''''''This last line (above) is what is highlighted
 

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