Any way to get new instance of Excel on double-click?

  • Thread starter Thread starter Ken Shaffer
  • Start date Start date
K

Ken Shaffer

I have a VB program which manipulates a workbook via excel object created.
Then if I open another spreadsheet by double-clicking, I see the spreadsheet
being manipulated is in the Window list as well as the one I just opened.

Is there a way that double-clicking will bring up a new instance of Excel so
that the spreadsheets being manipulated via VB won't be seen? Perhaps in the
VB program itself there might be an option to set so that windows thinks
Excel hasn't started yet and so creates a new instance to open it.

Thanks,

Ken Shaffer
 
Hi Ken,

try -

xlApp.IgnoreRemoteRequests = True

You may want to trap the original value and restore before xlApp.quit

Regards,
Peter T
 
Ken Shaffer said:
I have a VB program which manipulates a workbook via excel object created.
Then if I open another spreadsheet by double-clicking, I see the
spreadsheet
being manipulated is in the Window list as well as the one I just opened.

Is there a way that double-clicking will bring up a new instance of Excel
so
that the spreadsheets being manipulated via VB won't be seen? Perhaps in
the
VB program itself there might be an option to set so that windows thinks
Excel hasn't started yet and so creates a new instance to open it.

Thanks,

Ken Shaffer

VB? I assume you mean VBA, right? You can start a new Excel instance like
this
Dim objXL As Excel.Application
Set objXL = New Excel.Application
You can then let this new instance open another spreadsheet. Could you
explain why you want to do this? What's your problem?

/Fredrik
 
That did it! I now see 2 EXCEL processes after double-clicking.

Thanks! BTW, how'd you know? Help wasn't very helpful, so off to the
newsgroup I went.

ken
 
Well, not sure of the nomenclature, I guess a VB program manipulating
another application is VBA, whereas a VB macro in Excel is VBE.

Anyway, Peter's solution worked for me.

But for clarification I want to be able to use Excel normally without
interfering with the Excel object being used by the VBA program. So, while
the VBA program is running, if I then use Windows and move my mouse over to
another spreadsheet and double-click, I don't want to see any workbooks
being manipulated by the VBA program in the Excel->Window list.

A simple test: close out all instances of Excel, verify not in task manager
process list. Start VBA and place a breakpoint after opening a workbook of
interest and run the program waiting for the breakpoint to occur. Next,
double-click on some other spreadsheet and view the Excel->Window list. The
workbook loaded by the VBA program should *NOT* be in the list.

Hope that clarifies things.

ken
 
Thanks! BTW, how'd you know? Help wasn't very helpful, so off to the
newsgroup I went.

I don't know! Maybe I discovered it myself a long time ago or perhaps I had
read about it in this ng.

"Help" is unsurpassed as a reference but often requires you already know the
keyword you want to know more about.

In your adjacent to Fredrick - to clarify

VB - generic Visual Basic, the basis of VB6, VBScript, VBA etc
VBA - VB for (Office) Applications, with many extended functions for the
specific app (eg Excel)

The Q&A of this post could apply to any of the above where a reference has
been set to the excel.application, whether explicitly or implicitly (eg VBA
is hosted in the current instance).

VBE - Visual Basic Editor

Regards,
Peter T
 
Peter T said:
In your adjacent to Fredrick - to clarify ....
The Q&A of this post could apply to any of the above where a reference has
been set to the excel.application, whether explicitly or implicitly (eg VBA
is hosted in the current instance).

Thanks. I posed here because it seemed pertinent to Excel, so I guess I did
the right thing and not pose a similar question on the vb newsgroup.
VBE - Visual Basic Editor

doh! I knew that!


ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top