ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Crashing XL on reload (https://www.excelbanter.com/excel-programming/321432-vba-crashing-xl-reload.html)

Andrew Marshall

VBA Crashing XL on reload
 
I have an outlook macro, automating XL. Pseudo code follows

begin
If XL running
use existing instance
else
create new instance

open workbook( filename )
make changes to workbook
end

The crash occurs if I reload the workbook I opened. I cannot close the
workbook programmatically since the point of the macro is to allow the user
to examine the changes. Has anyone seen anything like this before?

Many thanks,
Andrew.

Tom Ogilvy

VBA Crashing XL on reload
 
Check the task manager and see if Excel is already running. I don't believe
GetObject will discover this situation if Excel is "hung up" because you
code has failed to release a reference to it.

--
Regards,
Tom Ogilvy

"Andrew Marshall" wrote in
message ...
I have an outlook macro, automating XL. Pseudo code follows

begin
If XL running
use existing instance
else
create new instance

open workbook( filename )
make changes to workbook
end

The crash occurs if I reload the workbook I opened. I cannot close the
workbook programmatically since the point of the macro is to allow the

user
to examine the changes. Has anyone seen anything like this before?

Many thanks,
Andrew.





All times are GMT +1. The time now is 07:27 PM.

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