ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run-time error '1004' at "Application.Calculate" (https://www.excelbanter.com/excel-programming/384305-run-time-error-1004-application-calculate.html)

PCLIVE

Run-time error '1004' at "Application.Calculate"
 
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



Madhan

Run-time error '1004' at "Application.Calculate"
 
Hi, please post the buggy code snippet.

"PCLIVE" wrote:

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




PCLIVE

Run-time error '1004' at "Application.Calculate"
 
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





"Madhan" wrote in message
...
Hi, please post the buggy code snippet.

"PCLIVE" wrote:

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







All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com