Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro in a spreadsheet that receives a userid and password, then
calls a cmd file to start an app to generate spreadsheet reports from data in an Oracle database. I find that the macro does not wait for the cmd file to finish executing before continuing to the following steps. I have put in a timing loop to stall (hopefully) long enough for the code to finish, but I would assume that there is a more elegant solution. How can I get the macro to wait for the cmd file to finish its work before I start trying to use the resulting spreadsheet reports that it generates? If it helps, here is the section of code that I am using. ' Log onto Discoverer, run the workbooks and export the results to Excel ChDir ("P:\Reports\RDS\Admissions\SpreadsheetRawData\ ") Shell "P:\Reports\RDS\Admissions\SpreadsheetRawData\_Dat aGetter.cmd " & logonstring, vbNormalFocus ' ' Give Discoverer time to run newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 12 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime ' ' Open the Excel raw data sheets to update the data in the master report Sheets("Raw Data Sheet").Select ActiveWindow.SmallScroll Down:=-27 Range("A29").Select Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True Windows("_ADMU Funnel Reports - Enrollment Report .xls").Activate and so forth... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Make onTimer wait until Excel finish database request? | Excel Programming | |||
where can i get a software program called Microfit? | Excel Discussion (Misc queries) | |||
How to access a called sub program to edit? | Excel Programming | |||
Microsoft excel is waiting for other program to finish OLE Action | Excel Programming | |||
Input variables on Sheet1 being called by a VB program on Sheet 2 | Excel Programming |