Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Opening Excel File Delay

onkelhotte
New Contributor II
603 Views
Hi there,
I want to open an Excel file, when the user pushes the appropiate button on my QuickWin Dialog.
I use the command "call system(excelfilename)" to open the file. After the user pushes the button, a black command line box appears. Thats normal until now. But then it takes 30 seconds before Excel will be opened. The command line box stays in foreground for all the time. Using l = systemmqq(excelfilename) doesnt work too.
A small testprogram (console app) opens the excel file immediatly...
program CallSystem
use dflib
call system('C:ProjekteEingabe_DSCTestdatenSpritzplan.xls')
end program
Do I have to initialize something for QuickWin before opening the file?
Thanks in advance,
Onkel Hotte

Message Edited by OnkelHotte on 06-17-2005 04:21 AM

0 Kudos
3 Replies
Steven_L_Intel1
Employee
603 Views
This has nothing to do with QuickWin. I have often seen rather long delays opening Excel in many different applications. Once you call system or systemqq, any delay is due to the command you have specified.
0 Kudos
anthonyrichards
New Contributor III
603 Views
if(SHINFO%hInstapp.lt.32) then
retlog=MESSAGEBOX(hwnd,'Failed to find file//launch EXCEL'C, &
'Problem opening EXCEL 'C, &
MB_ICONEXCLAMATION .OR. MB_OK)


endif

Message Edited by anthonyrichards on 06-17-2005 07:05 AM

Message Edited by anthonyrichards on 06-17-2005 07:14 AM

0 Kudos
anthonyrichards
New Contributor III
603 Views
I tried toadd some code to my previous message-code and succeeded in deleting the original message! Here is what I recommend again...
Code:
USE DFWINTY

TYPE (T_SHELLEXECUTEINFO) SHINFO
CHARACTER*100 EXCEL
INTEGER HWND
LOGICAL RETLOG

! add your own path to EXCEL here, or use an environment variable
! that you define, and obtain it using GETENVQQ...
EXCEL="C:PROGRAM FILESMICROSOFT OFFICEOFFICEEXCEL.EXE"C
HWND=GETMODULEHANDLE(NULL)

SHINFO%cbSize=		sizeof(SHINFO)
SHINFO%Fmask=		SEE_MASK_NOCLOSEPROCESS 
SHINFO%hwnd=		HWND
SHINFO%lpVerb=		loc('open'c)
SHINFO%lpFile=		loc(EXCEL)
! ADD YOUR FILENAME HERE
SHINFO%lpParameters=loc("C:TEMPDUMMY.XLS"c )
SHINFO%lpDirectory=	loc('C:'C)
SHINFO%nShow=		SW_HIDE

retlog=ShellExecuteEx(SHINFO)
! CHECK FOR FAILURE...
if(SHINFO%hInstapp.lt.32) then
	retlog=MESSAGEBOX(HWND,'Failed to find file//launch EXCEL'C, &
	'Problem opening EXCEL'C, &
	MB_ICONEXCLAMATION .OR. MB_OK)
endif
P.S. change contents of SHINFO%nShowfrom'SW_HIDE'to SW_SHOW

Message Edited by anthonyrichards on 06-20-2005 02:40 AM

Message Edited by anthonyrichards on 06-20-2005 02:40 AM

0 Kudos
Reply