FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Shellexecute problem.
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Shellexecute problem.
Posted: Sat Oct 25, 2008 05:30 PM
Trying to open a prn file in excel using the following code.

local cfile   := ":\"	
local cName   := Curdir()		
local cDri    := curDrive()	

cFile := cDri+cFile+cName		

ShellExecute( 0,"Open","Excel", "BSfile.prn","cFile",9)


The BSfile.prn is created in my program.

It opens two Excel files.
1 is OK but opens a second copy in read only.

How to fix and get one working.

Thanks in advance.

Harvey
Thank you

Harvey
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Shellexecute problem.
Posted: Sat Oct 25, 2008 06:59 PM
Harvy

Try this .. let the local machine figure out what to open the file with .. if it is an .xls .. Excel will be launched ..

SHELLEXECUTE( "", "open", cFILE ,"","",1)


Rick Lipkin
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Shellexecute problem.
Posted: Sat Oct 25, 2008 07:26 PM
Thanks for the quick response.

The file I create is a .prn file not an xls. Need to tell what to open it with.
I did this
shellexecute("","excel",myfile," ",1)


Still got two copies.
Thank you

Harvey
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Shellexecute problem.
Posted: Sat Oct 25, 2008 07:49 PM
Harvy

you might want to try WaitRun .. here is an example I use for Notepad :

WAITRUN( "NOTEPAD " +cFILENAME, 1 )


It assumes Notepad is in the 'path' to run ..

RIck Lipkin
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Shellexecute problem.
Posted: Sat Oct 25, 2008 09:42 PM

Problem solved.

After reviewing your suggestions, nothing worked. i went through the code and found it was a redundantcy in my code. My fault. :oops:

Thank you

Harvey

Continue the discussion