Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make Excel open new files in separate windows?

Status
Not open for further replies.

micha12

Programmer
Dec 11, 2002
10
RU
Hello everybody,

I have an Excel workbook with a macro. When I open this workbook, the macro creates special interface: it hides control bars, the status bar, ... The problem is that when the user double clicks another .xls file, the new file opens in the same window, where I already have my special workbook with a macro and special interface. What I want is to make all files to open in a separate Excel Application window.

I want to do this so that the workbook with my program would always be in a separate Excel Window, and that no other files could be opened in the same Excel window.

How can this be achieved?

Thanks.
 
This may have repercusions in the event of a crash, but nothing too serious. In the WorkbookOpen event of your application include the line
Code:
    Application.IgnoreRemoteRequests = True
You should reset things with
Code:
    Application.IgnoreRemoteRequests = False
in the Close event.

This will have the effect of creating a new instance of Excel whenever Excel is invoked by clicking on a file name.
 
Hello,

Thanks very much for your answer. It works, but in fact I do not understand one thing: when you instruct Excel to ignore remote requests, and do not switch on back this property, Excel won't open any files if you double click on them, because DDE is disabled. But if this property is disabled when my workbook is still open, new files can be opened by double-clicking on them. That is, you switch off DDE, but Excel still opens files if you double-click on them. Why since DDE is disabled?

And another thing: you wrote that the code should be included in the WorkbookOpen event of my Application. Maybe you meant the Workbook_Open event? This is the Open event of the Workbook object, and not the Application_WorkbookOpen event, these events are different.

Anyway, THANKS. It works! (though it shouldn't!)
 
I'm sorry I mentioned the words "in the event of a crash". The important word was repercusions, but if you swithced the value to true when you were done (as I suggested) the result of the repercusions would apply only if Excel exited ungracefully before you reset things.

A.C.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top