Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Application.Run and VBE "phantom" projects

Over the years, I've seen allusions to circumstances in which the VBE's
Project Explorer retains a reference to just-closed workbooks, but
still can't understand whether this can be avoided. Here's a simple
example:

Set Wkb = Workbooks.Open(Path)
Call Application.Run("'" & Wkb.Name & "'!Install")
Call Wkb.Close
Set Wkb = Nothing

Path is the full path of an existing, closed workbook containing
nothing but one public sub, Install, which just shows a MsgBox.

After this code has run, the VBE's Project Explorer still includes Wkb.
The "View Object" button for ThisWorkbook and it's sole Sheet1 are
greyed out. I can, however, still see the code. Moreover, I still can
execute this code (using F5). Attempting to DebugCompile, on the
other hand, fails with an "Out of Memory" error. And attempting to
remove the "phantom" code module crashes Excel. In most -- maybe all
-- instances (it's hard to remember all the variations I've tried),
restarting Excel eliminates the phantom. But that doesn't really solve
anything if one wants to use code such as this and continue working,
especially because Excel is near-unstable.

Maybe I've gotten Excel corrupted somehow, and this behavior cannot be
reproduced on a clean system. If not, has anyone been able to identify
why this happens and whether there is a work-around?

Thanks,
Keith

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 best "scrub" a wkbk of "phantom macros"? Dave Braden Excel Discussion (Misc queries) 5 January 4th 10 03:12 PM
"Phantom" Rows in Excel Merlyn Excel Discussion (Misc queries) 2 March 12th 09 04:43 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"WinForm Application" to act as "RTD Server" using .Net mduraidi Excel Discussion (Misc queries) 0 March 30th 06 01:01 PM
Can never edit my projects, everything is always "read-only mode" Maury Markowitz Excel Programming 8 March 29th 05 03:41 PM


All times are GMT +1. The time now is 08:33 PM.

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"