How to open an excel file with an .exe software?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

How to open an excel file with an .exe software?

15 Jul 2021, 12:46

Hello,

Example: Usually the command to open an excel file in C slot as below

Code: Select all

ButtonOpen:
Run C:\excel file.xlsx
return
But I have a VBA excel file that needs to use a special .exe software to open it. Usually, I drag the excel file to the .exe software.
Is there any command that can be executed quickly???
By the way, I cannot provide a VBA excel file and special .exe. software, If you open the excel file directly, you cannot open it
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: How to open an excel file with an .exe software?

15 Jul 2021, 13:57

Kevin_yeh2020 wrote: By the way, I cannot provide a VBA excel file and special .exe. software, If you open the excel file directly, you cannot open it
I don't know what you mean by this. Are you saying you can't run your special .exe software and passing the Excel file as an argument to it? Something like this:

Code: Select all

Run, C:\Program Files\SpecialSoftwareInstallationDir\special.exe "C:\PathToMyExcelFile\file.xlsx"
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

Re: How to open an excel file with an .exe software?

15 Jul 2021, 15:31

boiler wrote:
15 Jul 2021, 13:57
Kevin_yeh2020 wrote: By the way, I cannot provide a VBA excel file and special .exe. software, If you open the excel file directly, you cannot open it
I don't know what you mean by this. Are you saying you can't run your special .exe software and passing the Excel file as an argument to it? Something like this:

Code: Select all

Run, C:\Program Files\SpecialSoftwareInstallationDir\special.exe "C:\PathToMyExcelFile\file.xlsx"
Hi boiler,
Yes. Thanks for your reply.
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: How to open an excel file with an .exe software?

15 Jul 2021, 15:55

When you say "yes," do you mean as an answer to my question? Meaning you can't run the special .exe software and pass the Excel file as an argument? Did you try the one-line script I posted (but with the actual paths and file names)? What happened when you tried it?
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

Re: How to open an excel file with an .exe software?

24 Jul 2021, 05:20

boiler wrote:
15 Jul 2021, 15:55
When you say "yes," do you mean as an answer to my question? Meaning you can't run the special .exe software and pass the Excel file as an argument? Did you try the one-line script I posted (but with the actual paths and file names)? What happened when you tried it?
Hi, boiler,

Sorry for the late reply. Usually, we first open the .exe and then select excel.xls.
The result of my actual test is to open an empty .xls
I have tried the following, but the result is only to open an empty.xls
1.

Code: Select all

Run, C:\Program Files\SpecialSoftwareInstallationDir\special.exe "C:\specia.xls"
2.

Code: Select all

Run, "C:\Program Files\SpecialSoftwareInstallationDir\special.exe" "C:\specia.xls"
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: How to open an excel file with an .exe software?

24 Jul 2021, 08:36

Is it perhaps because your file is called special.xls and not specia.xls? Maybe not, but just checking. Is the file really at the root directory of the C: drive? Does it really have the older format of Excel file with the .xls extension and not .xlsx?
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

Re: How to open an excel file with an .exe software?

24 Jul 2021, 09:42

boiler wrote:
24 Jul 2021, 08:36
Is it perhaps because your file is called special.xls and not specia.xls? Maybe not, but just checking. Is the file really at the root directory of the C: drive? Does it really have the older format of Excel file with the .xls extension and not .xlsx?

Hi, boiler,

I checked again, both the .exe program and the excel.xls file paths are current. Look like that the .xls file has been read, but I don’t know why an empty xls file is opened...........

.exe program path:
C:\Program Files (x86)\xxxxxx\xxx-xxx\10.0.0.1_bi\xxxxx.exe

excel.xls fail path:
C:\xx xxx_xx.xls

Code: Select all

Run, C:\Program Files (x86)\xxxxxx\xxx-xxx\10.0.0.1_bi\xxxxx.exe "C:\xx xxx_xx.xls"
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: How to open an excel file with an .exe software?

24 Jul 2021, 09:57

I would check to see that the program actually accepts a file to be opened as a parameter. Can you type that line into a CMD window and get it to open that application with the specified file?
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

Re: How to open an excel file with an .exe software?

24 Jul 2021, 10:11

boiler wrote:
24 Jul 2021, 09:57
I would check to see that the program actually accepts a file to be opened as a parameter. Can you type that line into a CMD window and get it to open that application with the specified file?
I drag the file to CMD and press ENTER, the file can be opened(it is not an empty file) but it cannot be run. It must use a special program.
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: How to open an excel file with an .exe software?

24 Jul 2021, 10:26

Click the Windows "Start" button and type CMD and press Enter. At the command prompt, type the line:

C:\Program Files (x86)\xxxxxx\xxx-xxx\10.0.0.1_bi\xxxxx.exe "C:\xx xxx_xx.xls"

with the actual paths and names, of course.
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: How to open an excel file with an .exe software?

24 Jul 2021, 10:29

Actually, since your path contains spaces, you will need to put quotes around the path to the application as well:

"C:\Program Files (x86)\xxxxxx\xxx-xxx\10.0.0.1_bi\xxxxx.exe" "C:\xx xxx_xx.xls"
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

Re: How to open an excel file with an .exe software?

24 Jul 2021, 11:04

boiler wrote:
24 Jul 2021, 10:29
Actually, since your path contains spaces, you will need to put quotes around the path to the application as well:

"C:\Program Files (x86)\xxxxxx\xxx-xxx\10.0.0.1_bi\xxxxx.exe" "C:\xx xxx_xx.xls"
Hi, boiler,

Same issue. Even if I put double well, it still doesn't work in the CMD.
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: How to open an excel file with an .exe software?

24 Jul 2021, 11:23

Then it seems like your program isn’t designed to accept a file to be opened as a parameter, so it’s not an issue of forming the AHK command correctly. Try the same thing but use Excel as the application, and I think you’ll see it will open it, which would help demonstrate that it’s your other application doesn’t have that feature.
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

Re: How to open an excel file with an .exe software?

24 Jul 2021, 14:39

boiler wrote:
24 Jul 2021, 11:23
Then it seems like your program isn’t designed to accept a file to be opened as a parameter, so it’s not an issue of forming the AHK command correctly. Try the same thing but use Excel as the application, and I think you’ll see it will open it, which would help demonstrate that it’s your other application doesn’t have that feature.
Ok. Thanks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Joey5, Nerafius, RandomBoy, Rohwedder and 153 guests