Is my spreadsheet open?

  • Thread starter Thread starter rci
  • Start date Start date
R

rci

Hi all...

I have set up a file association on my Windows XP system such that it opens
a specific Excel workbook.

This all works great.

Now, if I double click a file with that same extension, I am wondering if I
can somehow have code in the workbook that can check to see if it is the
only instance of itself being open on my system. Currently, doing so opens
anther excel session, and then the workbook is opened again.

My goal here is to tell the user that the worksheet is already open, and
then close itself.

Hope that makes sense :-)


How might I accomplish this?

Mike
 
I don't think Excel is a single instance application.

Try the following method

ActivateMicrosoftApp Method

Activates a Microsoft application. If the application is
already running, this method activates the running
application. If the application isn't running, this method
starts a new instance of the application.

Syntax

expression.ActivateMicrosoftApp(index)

expression Required. An expression that returns an
Application object.

index Required Long. Specifies the Microsoft
application to activate. Can be one of the following
XlMSApplication constants: xlMicrosoftWord,
xlMicrosoftPowerPoint, xlMicrosoftMail, xlMicrosoftAccess,
xlMicrosoftFoxPro, xlMicrosoftProject, or
xlMicrosoftSchedulePlus.
 

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