Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default Code Execution has been interrupted - ??

Hello I have this sub and since today I have this error the code stops
very strangely tell me that there is a code execution breaking. any
suggestions??

Public Sub Workbook_Open()
' ************
' Variables
' ************
Dim dtmTime As Date
Dim dtmSave As Date
Dim oExec As Object

' ************
' Call function OpenPHObject; in order to execute sub operations I need
to open this software
' ************
Set oExec = OpenPHObject()

' ************
' Cursor in clock shape
' ************
Application.Cursor = xlWait
DoEvents

On Error Resume Next
' ************
' After seven seconds the macros has been launched
' ************
dtmTime = Now + TimeValue("00:00:07")
' ************
' Open the sub in thisworkbook
' ************
Application.OnTime dtmTime, "thisworkbook.operations"
Application.Cursor = xlDefault
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\test\testsave.xls", ReadOnlyRecommended:=False, CreateBackup:=False
'Application.DisplayAlerts = True
' ************
' Now + 7seconds + 30 seconds -- launch SAVEandEXIT and close PH
' ************
dtmSave = dtmTime + TimeValue("00:00:30")
Application.OnTime dtmSave, "thisWorkBook.Save_Exit"

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Code Execution has been interrupted - ??

Where does it break?

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"ina" wrote in message
oups.com...
Hello I have this sub and since today I have this error the code stops
very strangely tell me that there is a code execution breaking. any
suggestions??

Public Sub Workbook_Open()
' ************
' Variables
' ************
Dim dtmTime As Date
Dim dtmSave As Date
Dim oExec As Object

' ************
' Call function OpenPHObject; in order to execute sub operations I need
to open this software
' ************
Set oExec = OpenPHObject()

' ************
' Cursor in clock shape
' ************
Application.Cursor = xlWait
DoEvents

On Error Resume Next
' ************
' After seven seconds the macros has been launched
' ************
dtmTime = Now + TimeValue("00:00:07")
' ************
' Open the sub in thisworkbook
' ************
Application.OnTime dtmTime, "thisworkbook.operations"
Application.Cursor = xlDefault
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\test\testsave.xls", ReadOnlyRecommended:=False, CreateBackup:=False
'Application.DisplayAlerts = True
' ************
' Now + 7seconds + 30 seconds -- launch SAVEandEXIT and close PH
' ************
dtmSave = dtmTime + TimeValue("00:00:30")
Application.OnTime dtmSave, "thisWorkBook.Save_Exit"

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default Code Execution has been interrupted - ??

in this part

'Application.DisplayAlerts = True ' here but if I comment goes to
dtmSave because dtmSave = 00:00:00
' ************
' Now + 7seconds + 30 seconds -- launch SAVEandEXIT and close PH
' ************
dtmSave = dtmTime + TimeValue("00:00:30") ' here
Application.OnTime dtmSave, "thisWorkBook.Save_Exit"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code Execution has been interrupted - ??

I had this problem after hitting Control-Break during the execution of
a macro. Once it starts, it seems to (somewhat randomly) affect all
MS-Office macros.

The solution for me was very simple though: reboot the computer. (A
complete reboot was required - simply logging off was not sufficient).

The problem seems to have nothing to do with the macros themselves -
after rebooting, they're all working fine.


ina wrote:
in this part

'Application.DisplayAlerts = True ' here but if I comment goes to
dtmSave because dtmSave = 00:00:00
' ************
' Now + 7seconds + 30 seconds -- launch SAVEandEXIT and close PH
' ************
dtmSave = dtmTime + TimeValue("00:00:30") ' here
Application.OnTime dtmSave, "thisWorkBook.Save_Exit"


  #5   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default Code Execution has been interrupted - ??

Good thanks, very strange VBA sometimes

Tim Hull wrote:
I had this problem after hitting Control-Break during the execution of
a macro. Once it starts, it seems to (somewhat randomly) affect all
MS-Office macros.

The solution for me was very simple though: reboot the computer. (A
complete reboot was required - simply logging off was not sufficient).

The problem seems to have nothing to do with the macros themselves -
after rebooting, they're all working fine.


ina wrote:
in this part

'Application.DisplayAlerts = True ' here but if I comment goes to
dtmSave because dtmSave = 00:00:00
' ************
' Now + 7seconds + 30 seconds -- launch SAVEandEXIT and close PH
' ************
dtmSave = dtmTime + TimeValue("00:00:30") ' here
Application.OnTime dtmSave, "thisWorkBook.Save_Exit"


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code execution has been interrupted Stuart C Excel Programming 3 March 23rd 06 09:02 AM
Code execution has been interrupted Red[_4_] Excel Programming 3 October 6th 05 06:26 AM
Code execution has been interrupted Who I Am Excel Programming 5 September 28th 05 03:32 PM
Code Execution has been Interrupted JPutman Excel Programming 4 August 24th 04 02:17 PM
Code Execution Has been Interrupted Adrian[_7_] Excel Programming 0 July 30th 04 10:02 AM


All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"