Forcing Worksheet to be the first instance

mtheriault2000

Well-known Member
Joined
Oct 23, 2008
Messages
826
Hello

An external software application will communicate with Excel. One of the condition is the worksheet need to be the first instance

Is there a way to force the opening of an Excel file in the first instance.

Honestly, I don't know what it is all about. :confused: I should received the excel file next week and I would like to be prepare for that

Martin
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I am not sure if this is correct, but do you want a specific sheet to open up each time the excel workbook is opened? If so, here is how to do that:

I also don't know how much you know about VBA, so if something does not make sense, please just ask and I'll walk you through it.

In the VBA editor go into the ThisWorkbook item in the Project window.

Create a Private Sub that looks like this:

Private Sub Workbook_Open()
Sheets(" put the name of the worksheet you want to show when the file is opened in here ").Activate
End Sub

That code will make sure that every time that the file is opened, the correct sheet will be displayed. I hope that is what you wanted.
 
Upvote 0
As far as I know, each time a new Excel file ( Excel.exe) is execute, it create a new instance

If you open a new workbook using Office Button, File Open, the new workbook will have the same instance

If you open a workbook using Windows, Program, Excel.exe, then a new instance will be created

I'm looking for a solution to make sure that the Excel file to be open ("MarketData") will always be instance #1.

That is the way I understood the problem. Please excuse and correct me if my understanding is erroneous

I think I have seen a software patch to do that, but can't recall how I found it

Martin
 
Upvote 0
I think I understand now. I'm not sure exactly how to do this, but I have done something that might work for you a long time ago. I hope my memory is correct, but this should always open your file in the first instance of Excel.

I created a shortcut to my spreadsheet, and placed it in the /xlstart folder in the Excel program's folder. The idea is that every time Excel is opened, the shortcuts in that folder are opened before anything else. I was running Windows XP on my work machine, and the address of this folder was C:\Program Files\Microsoft Office\Office12\XLSTART. If you are running a 64-bit system or a different version of Excel the directory might be different, but it should be close to that. If you place the shortcut in that folder, whenever Excel opens, that file should always open in the first instance.
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top