ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inconsistent behaviour Stop Statement (https://www.excelbanter.com/excel-programming/367203-inconsistent-behaviour-stop-statement.html)

RB Smissaert

Inconsistent behaviour Stop Statement
 
To get to the bottom of a problem that proves difficult to pin down I have
added a conditional Stop Statement
to the Workbook_Open event of a .xla add-in.
This add-in will not be loaded as an add-in (no tick under Tools, Add-ins)
but gets opened by another add-in.

So, add-in 1 does: Open strAddin2FullPath
and in the Workbook_Open event of this add-in 2 I have:

If Cells(1) = "stop" Then
Stop
End If

This comes directly after the Sub header and after some local variables.

On the home setup (Excel 2003, Windows XP) this works fine, so it will step
nicely through all the code
of the Workbook_Open event of add-in 2.
At work though it stops at the line: Open strAddin2FullPath of add-in 1and
goes no further.

I have now moved the Stop statement down in that Sub a bit, so some other
code lines will run before the Stop
and hopefully that will solve it.

Any ideas/suggestions here?


RBS



[email protected]

Inconsistent behaviour Stop Statement
 
Just have tried this at work and still not working, so moving the Stop
statement a few
statements down didn't solve it.

RBS


RB Smissaert wrote:
To get to the bottom of a problem that proves difficult to pin down I have
added a conditional Stop Statement
to the Workbook_Open event of a .xla add-in.
This add-in will not be loaded as an add-in (no tick under Tools, Add-ins)
but gets opened by another add-in.

So, add-in 1 does: Open strAddin2FullPath
and in the Workbook_Open event of this add-in 2 I have:

If Cells(1) = "stop" Then
Stop
End If

This comes directly after the Sub header and after some local variables.

On the home setup (Excel 2003, Windows XP) this works fine, so it will step
nicely through all the code
of the Workbook_Open event of add-in 2.
At work though it stops at the line: Open strAddin2FullPath of add-in 1and
goes no further.

I have now moved the Stop statement down in that Sub a bit, so some other
code lines will run before the Stop
and hopefully that will solve it.

Any ideas/suggestions here?


RBS



Peter T

Inconsistent behaviour Stop Statement
 
Hi Bart,

No idea why that doesn't work, maybe this might

If ActiveSheet.Range("A1").Value = "error" Then
On Error GoTo 0
N = 1 / 0
'err.clear / resume original error handling
End If

Regards,
Peter T


wrote in message
oups.com...
Just have tried this at work and still not working, so moving the Stop
statement a few
statements down didn't solve it.

RBS


RB Smissaert wrote:
To get to the bottom of a problem that proves difficult to pin down I

have
added a conditional Stop Statement
to the Workbook_Open event of a .xla add-in.
This add-in will not be loaded as an add-in (no tick under Tools,

Add-ins)
but gets opened by another add-in.

So, add-in 1 does: Open strAddin2FullPath
and in the Workbook_Open event of this add-in 2 I have:

If Cells(1) = "stop" Then
Stop
End If

This comes directly after the Sub header and after some local variables.

On the home setup (Excel 2003, Windows XP) this works fine, so it will

step
nicely through all the code
of the Workbook_Open event of add-in 2.
At work though it stops at the line: Open strAddin2FullPath of add-in

1and
goes no further.

I have now moved the Stop statement down in that Sub a bit, so some

other
code lines will run before the Stop
and hopefully that will solve it.

Any ideas/suggestions here?


RBS





RB Smissaert

Inconsistent behaviour Stop Statement
 
Hi Peter,

So,
On Error GoTo 0
N = 1 / 0
comes in place of Stop?

Will give that a try, thanks.

RBS

"Peter T" <peter_t@discussions wrote in message
...
Hi Bart,

No idea why that doesn't work, maybe this might

If ActiveSheet.Range("A1").Value = "error" Then
On Error GoTo 0
N = 1 / 0
'err.clear / resume original error handling
End If

Regards,
Peter T


wrote in message
oups.com...
Just have tried this at work and still not working, so moving the Stop
statement a few
statements down didn't solve it.

RBS


RB Smissaert wrote:
To get to the bottom of a problem that proves difficult to pin down I

have
added a conditional Stop Statement
to the Workbook_Open event of a .xla add-in.
This add-in will not be loaded as an add-in (no tick under Tools,

Add-ins)
but gets opened by another add-in.

So, add-in 1 does: Open strAddin2FullPath
and in the Workbook_Open event of this add-in 2 I have:

If Cells(1) = "stop" Then
Stop
End If

This comes directly after the Sub header and after some local
variables.

On the home setup (Excel 2003, Windows XP) this works fine, so it will

step
nicely through all the code
of the Workbook_Open event of add-in 2.
At work though it stops at the line: Open strAddin2FullPath of add-in

1and
goes no further.

I have now moved the Stop statement down in that Sub a bit, so some

other
code lines will run before the Stop
and hopefully that will solve it.

Any ideas/suggestions here?


RBS







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

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