Launching a file Into a Windows application

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 13108
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Launching a file Into a Windows application

Post by ChrisGreaves »

Generally speaking, when I want to launch a compiled program (*.exe) from a VBA macro, I build a line for SHELL and launch that.
I work out how to build the parameters for the SHELL command by opening a command prompt and practicing there.

program.exe /help or program.exe /? sometimes gives me a help screen
program.exe myfile.ext sometimes does the trick (the program opens and then opens and processes the file)

I am faced with a very simple program that won't play by my rules! I have to load the program and then use its simple windows interface and "click on file and then click on open" or else "drag your file into this area", and I just HATE work like that. Computers are supposed to do boring and repetitive tasks, and if I have a slew of files in a folder, I should be able to process them in a batch, by hook or by crook.

I have never been able to get SendKeys to work (Win95 and onwards)

Is there some magic way to get this done automatically?
I suspect that one of you will start describing Windows APIs and so on.

In the meantime I am trying to track down the program author who is, I suspect, someone's very busy husband who was asked to write the program some years ago, and pressed for time, did a simple mouse-based user interface.

Thanks for any tips
Chris
Don’t let a good crisis go to waste

JoeP
SilverLounger
Posts: 1743
Joined: 25 Jan 2010, 02:12

Re: Launching a file Into a Windows application

Post by JoeP »

Have you tried the variations of the "help" switch such as -?, /h, -h, -help, --help?

There is no general method for discovering command line arguments. So, if you can't find it by experimenting with "help" I think you are out of luck.

Depending on what the objective is, you may be able to construct a PowerShell script to do what you wish.
Joe

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 13108
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Launching a file Into a Windows application

Post by ChrisGreaves »

JoeP wrote:
13 Jan 2022, 17:09
Have you tried the variations of the "help" switch such as -?, /h, -h, -help, --help?
Hi Joe.
Yes, for once in my life I was a few seconds ahead of you.
.. I think you are out of luck.
I have no response in the nine-year old thread of the lady who posted her husband's program They might have retired and moved to Bonavista, for all I know. :hairout:
... you may be able to construct a PowerShell script to do what you wish.
Here we go again!

OK. Thanks again.
It is always useful to get confirmation that a dead-end might be in sight and not to waste time banging the old head against the brick wall.
Cheers
chris
Don’t let a good crisis go to waste