Opening excel files from menu

I made a New Menu in the toolbar and added several Excel files - the problem I experience is that I can only open ONE Excel file this way; once the first file is open, clicking on a second will have no effect at all ... when I do the same thing with PDF files, the problem does not occur.

Using Excel 2007 I see the same thing happens to me. The only solution I know of is to specify the full path to the excel.exe file (in each button) followed by the spreadsheet you want to open. That works for me although it opens a new instance of Excel each time.

"C:\Program Files\Microsoft Office\Office12\EXCEL.EXE" "D:\Customer Files\Test File.xls"

There very well may be a better solution, I don't use Microsoft Office any more than I have to so I'm not real familiar with it.

I can't reproduce this, FWIW. (Excel 2007 as well.)

You're not trying to open several files with the same name in Excel, are you? That won't usually work due to the design of Excel.

No Leo, filenames are different; this is simply a Menu Button with several Excel files (with different names) dragged into it, so they show as other (sub)buttons; if you customize and edit (each) (sub)button, it looks like this:

"X:\Folder A\Excel files\file1.xls"
"X:\Folder B\Excel files\file2.xls"

Now if Excel is closed, each (sub)button will work as expected, but once Excel is active, the buttons will no longer open the file; they do something though, as the Excel window is activated, but the file will not open. I also have files in the XLSTART folder which will be opened first (removing them is no solution); Word files have the same problem, whereas Acrobat PDF do not.

I once (9.1 and a fairly cluttered system on my computer) mentioned the same problem to GPSoftware and got an answer from Greg Perry saying he could not reproduce the problem; he did mention though that all files opened in different Excel instances (see JohnZeman - that solution works, but I find it very annoying, if only because it will refuse to open the XLSTART files in other than read-only mode except for the first Excel instance). Now my system has recently been reformatted, is clean and fast and Dopus is 9.5 but the problem seems to be sticky ...

Does the same thing happen if you double-click those files instead of using the menu?

If so, does it also happen if you double-click them in Explorer instead of Opus?

I use single clicking but that works normally: I can open as many files as I like in Opus, all in the same Excel instance; I then disabled single clicking (just to check) but no dice ...

Same thing in Explorer, everything okay, using either single or double clicking.

Is your XLS open action the same as below?

Hmm, maybe it only happens on 32-bit machines. Looks like John is on 32-bit and that's the only difference I can think of compared to my Excel install (which is vanilla Excel 2007).

mmm Leo, don't know exactly where I have to get that info on my XP SP3 system, or what I would have to compare it to ... ?

Settings -> File Types -> .xls

Yes, I am on a 32 bit machine Leo and my .xls file type is configured exactly like your screen shot.

Thinking it may have something to do with Excel's older xls file format, I just tried opening the newer xlsx format files in Excel 2007, but it still only opens the first one.

I set up a 32-bit XP VM with Office 2007 and it works fine for me there as well.

Here's a video showing what I see:

Leo that's the way it works for me too IF I include the full path to the excel executable as mentioned in post #2 in this thread.

You might want to try a little vbscript and automation.
I put a script named excel2.vbs in folder e:\vbscript. I have 2 spreadsheets in the same folder, cleverly named book1 and book2 (.xls). :slight_smile:
The script:

on error resume next
set theArgs=WScript.Arguments
set wa2=getObject(,"excel.Application")
if len(wa2)=0 then
	set wa2=getobject("","excel.Application")
end if
for each argument in theARgs
	set ospread=

(no error checking included)
Now, in the menu or buttons or whatever:

e:\vbscript\excel2.vbs "E:\vbscript\book2.xls"

If you want to use a generic button, you could use {filepath$} or whatever.

If Excel is already running, the first getobject statement will execute and get access to it, if excel is not running, it will fail and the second getobject will run opening Excel. The spreadsheet(s) referenced by the argument(s) will be opened in one instance of Excel. In the case where excel is open, they will be added. At least that is what it does here, but my systems have a reputation of being weird. :slight_smile:

Using VBScript/automation seems over the top when they say it works if they run Excel directly. i.e. Rather than running the .vbs with the file as an argument, they can just run Excel.exe with the file as an argument.

The question is why launching the file on its own is running into problems, and why I can't reproduce it (on two machines so far).

My bet is that something is messing up DDE, which is what Excel uses to launch pass files to itself when its already running and another file is launched. Working out the cause of DDE issues can be difficult, though. It could be an unrelated app that stops responding to window messages (DDE works by broadcasting messages to all windows) or it could be an add-on or error condition within Excel that's causing it not to respond to DDE messages.

It might be worth checking if other programs which use DDE exhibit the same problem. Try with some Word .doc files and some .HTML files. They both appear to use DDE as well on my system. (Though I'm not 100% sure about Word as the DDE message starts with "REM_" which might mean it's a dummy, unused message? HTML files will also vary depending on browser, of course, but it looks like both Firefox and IE use DDE in their HTML file types.)

Did anybody found a solution for this? Thanks!