From: John on
This code has been running for three years. All of a sudden I get "Code
execution has been interrupted" in the next line after
Application.GetOpenFilename. No matter what the user chooses (a file or
cancel). Is there a way to stop that without disabling the cancel
selection?
Thanks

John




ChDir "C:\Documents and Settings\Administrator\Desktop\Billing\State"
StateBilledFile = Application.GetOpenFilename("Excel Files,_
*.xls),Title:=,Open a Nancy + date.xls file")

' Test if Cancel button was clicked.
Select Case StateBilledFile
Case Is <> False
Workbooks.Open (StateBilledFile)
From: Rich Locus on
Hello:
If your code has been running for 3 years and now suddenly it stops, you
probably have an error in your Operating System or Excel has been corrupted.
I've been down similar roads. On my last unexplained behavior, after beating
my head against the wall, I finally did a system restore to an earlier state
and it fixed my issue.

Try running it in the debugger line by line if you haven't done that already
and maybe you can get a hint.
--
Rich Locus
Logicwurks, LLC


"John" wrote:

> This code has been running for three years. All of a sudden I get "Code
> execution has been interrupted" in the next line after
> Application.GetOpenFilename. No matter what the user chooses (a file or
> cancel). Is there a way to stop that without disabling the cancel
> selection?
> Thanks
>
> John
>
>
>
>
> ChDir "C:\Documents and Settings\Administrator\Desktop\Billing\State"
> StateBilledFile = Application.GetOpenFilename("Excel Files,_
> *.xls),Title:=,Open a Nancy + date.xls file")
>
> ' Test if Cancel button was clicked.
> Select Case StateBilledFile
> Case Is <> False
> Workbooks.Open (StateBilledFile)
> .
>
From: John on
Yeah, I ran it line by line. At GetOpenFilename it just says the same
thing. If I click continue the macro goes on perfectly.

It's as if the getopenfilname demands an interruption before going on
with a choice to continue or stop.

I can't think of anything new on the computer. It's vista with normal
upgrades.

It looks like I will just have to tell the users this is what happens
and click continue.

John
Rich Locus wrote:
> Hello:
> If your code has been running for 3 years and now suddenly it stops, you
> probably have an error in your Operating System or Excel has been corrupted.
> I've been down similar roads. On my last unexplained behavior, after beating
> my head against the wall, I finally did a system restore to an earlier state
> and it fixed my issue.
>
> Try running it in the debugger line by line if you haven't done that already
> and maybe you can get a hint.