PDA

View Full Version : running an external program while in an applicatio


ABC123

Rokrz
01-04-2002, 03:54 AM
I need some help creating a macro in my application that will allow me to call up a Windows Exel file. after adding some information to the spreadsheet, I want to print the sheet and then return to Alpha.

I have been able to accomplish this this manually by having a menu selection in the application that has the {mainmenu} command, but would really like to automate the process.

Ken L Herrold
01-04-2002, 03:50 PM
Bob:

I was amazed when I tried what you wanted. Here's what I did and it works.
---------
Alpha Script command...
{EXEC·"excel.bat",0,0}

Excel.bat
start c:progra~1micros~2officeexcel.exe test.xls
-------------
With alpha running in a window Excel comes up over it and leaves it undisturbed. When you're done with Excel, close it and alpha remains as it was.

Thinking further, you could replace 'test.xls' in the batch with %1 and then pass the file name to DOS via a prompted-for variable file name - then added to the commant parameter.

God, It looks really neat. I've used this method on full screen but it's not as smooth. It puts the full screen on the taskbar which then has to be clicked after closing Excel.

Put the batch in the application folder and you won't even have to use a path to it.

Let me know what happened

Ken

Try it, You'll like it.

Ken L Herrold
01-04-2002, 03:53 PM
Darnit.....

backslash problems again. You know where they go.

start c:/progra~1/micros~2/office/excel.exe test.xls

Ken

Ken L Herrold
01-04-2002, 05:24 PM
MORE:

Bob, We discussed the possibility of prompting for a report name and passing to DOS. D I D I T !

Script
--------------
{PROMPT·"Enter·the·file·name",·%fname,15}
{SET·%cmnd,"excel.bat"+"·"+%fname}
{EXEC·%cmnd,0,0}

Batch
--------------
start c:/progra~1/micros~2/office/excel.exe %1

I guess that a guy could even put the dos variable as
'%1.xls' and the user wouldn't have to do the extension at the prompt.

Man, this is fun........ Hope this is what you were looking for. I tried running the script from a menu selection and it still performed as advertised. I think we're on to something here.

Incidentally, Bob, I've done a backup/restore routine that runs from within Alpha from a menu choice which requires no hard-coded paths using the DOS variable, and a lot of command line options for PKZIP. I'll share it with you if you're interested.

Let me know.

GEEZ, I just happened to think, are you trying to pass alpha field information to the excel sheet? Man, I think I'd have problem with that but would like to try. I think I did something like that in an app that I did but it was the whole Alpha export - not field to field.

Ken

Ken L Herrold
01-08-2002, 09:39 AM
Bob:

I keep watching to see if you've responded and don't see any answers. Did it work, or is that not what you wanted, or did you already know all that stuff?

Ken

Rokrz
01-11-2002, 04:23 AM
Ken,

Thanks for the information on both of my pleas for help.
The @echooff works fine. Just what I wanted.

I have been out of the office most of the week so I have not had a chance to try your solution for running exel program from my application. Reviewed the concept last Monday and it seems reasonable and exactly what I want to do. Will let you know when I impolement.

Your question about passing fields from Alpha to Exel is very interesting and would be the ultimate automation of the process.

Before I go that route though, I would like to rethink the report (form letter to suppliers with performance data for quality and delivery inserted) using the windows printer capabilities now available.

Thanks again for the help.

Bob Okrzynski

Will Lynch
10-02-2002, 12:59 PM
I am interested in what you wrote for this routine. By the way.. ever figure out how to pass data to the excel sheet? That would be neat! :-)

-------------------You Wrote---------

I've done a backup/restore routine that runs from within Alpha from a menu choice which requires no hard-coded paths using the DOS variable, and a lot of command line options for PKZIP. I'll share it with you if you're interested.

Let me know.

GEEZ, I just happened to think, are you trying to pass alpha field information to the excel sheet? Man, I think I'd have problem with that but would like to try. I think I did something like that in an app that I did but it was the whole Alpha export - not field to field.

Rokrz
10-02-2002, 01:37 PM
The project got lost in the priorities shuffle. Actually now waiting for a breathing space to write my applications in Alpha Five V5.

Just never enough time to do all the projects that I can dream up.


Regards,


Bob Okrzynski