Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Excel Sheet from Paradox Button 1

Status
Not open for further replies.

bobsmallwood

Programmer
Aug 9, 2001
38
US
Is there a way to open an Excel Workbook from a pushbutton on a Paradox form?
 
Use execute

execute("C:\\Program Files\\Microsoft Office\\Office\\EXCEL.EXE file_to_open.xls")
 
If you use shellexecute, you don't even need to know where Excel is located (as long as the filetype is registered with Windows the associated program starts automagically):

Code:
uses "shell32.dll"
ShellExecuteA(hwnd clong, lpOperation cptr, lpFile cptr, lpParameters cptr, lpDirectory cptr, nShowCmd clong) clong
enduses

ShellExecuteA(0,"open","c:\\dir\\subdir\\filename.xls","","",3)
Put the above in a library, and make a custom method. Pass the file name to be loaded and you are good to go regardless of the external file you want to open.

As long as the file type you are passing has a default application associated with it, of course.

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top