Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to Stop VBA from executing

Dear all,

I have write VBA Code to close a workbook when it was open.
Now when I open the workbook, the workbook will close immediately, thus
I cannot edit the VBA Code. How can stop the VBA code from executing
and then I can edit the VBA code.

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default How to Stop VBA from executing

Try holding down the Shift key when you open the workbook.

"hon123456" wrote:

Dear all,

I have write VBA Code to close a workbook when it was open.
Now when I open the workbook, the workbook will close immediately, thus
I cannot edit the VBA Code. How can stop the VBA code from executing
and then I can edit the VBA code.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default How to Stop VBA from executing

JMB, You can also press ctrl/break(Pause) to stop the code.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default How to Stop VBA from executing

My impression is it was an autoopen macro. Depending on how long it takes
the macro to run, I think there may not be enough time.

Personally, I keep a button on my toolbar to toggle events on/off
Sub ToggleEvents()
With Application
.EnableEvents = Not .EnableEvents
If .EnableEvents Then
.StatusBar = False
Else: .StatusBar = "Events Are Disabled"
End If
End With
End Sub

But the OP could also set security to medium or high prior to opening the
workbook.

"Les Stout" wrote:

JMB, You can also press ctrl/break(Pause) to stop the code.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default How to Stop VBA from executing

I have had this problem as well recently and I solved it by doing
this...

debug.assert 1 = 2

Adding this as the first line in your Auto_Open and it will break on
its own each time its run.

Hope that helps.

theSquirrel



JMB wrote:
My impression is it was an autoopen macro. Depending on how long it takes
the macro to run, I think there may not be enough time.

Personally, I keep a button on my toolbar to toggle events on/off
Sub ToggleEvents()
With Application
.EnableEvents = Not .EnableEvents
If .EnableEvents Then
.StatusBar = False
Else: .StatusBar = "Events Are Disabled"
End If
End With
End Sub

But the OP could also set security to medium or high prior to opening the
workbook.

"Les Stout" wrote:

JMB, You can also press ctrl/break(Pause) to stop the code.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default How to Stop VBA from executing

Select disable macros on opening Excel.

If this does not appear open Excel and set security to medium, then close
Excel and open your problem workbook, then select disable macros.
--
Cheers
Nigel



"hon123456" wrote in message
ups.com...
Dear all,

I have write VBA Code to close a workbook when it was open.
Now when I open the workbook, the workbook will close immediately, thus
I cannot edit the VBA Code. How can stop the VBA code from executing
and then I can edit the VBA code.

Thanks.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default How to Stop VBA from executing

Keep the shift button pressed when you open your workbook.

Regards,
Steve

Nigel schrieb:

Select disable macros on opening Excel.

If this does not appear open Excel and set security to medium, then close
Excel and open your problem workbook, then select disable macros.
--
Cheers
Nigel



"hon123456" wrote in message
ups.com...
Dear all,

I have write VBA Code to close a workbook when it was open.
Now when I open the workbook, the workbook will close immediately, thus
I cannot edit the VBA Code. How can stop the VBA code from executing
and then I can edit the VBA code.

Thanks.


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
How can I stop a formula from executing based on a cell value? Ricke New Users to Excel 4 October 5th 08 09:39 PM
Excel Macro Stop Executing Agustus Excel Programming 0 March 27th 06 05:11 PM
executing an add in Gary Keramidas Excel Programming 6 November 6th 05 09:56 PM
How do I stop other circles in other cells to stop selecting? stauff Excel Worksheet Functions 2 October 29th 04 09:02 PM
How do I stop other circles in other boxes to stop selecting? stauff Excel Worksheet Functions 1 October 28th 04 10:27 PM


All times are GMT +1. The time now is 10:32 AM.

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

About Us

"It's about Microsoft Excel"