ExecuteFile> needs a Wait>

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3524
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

ExecuteFile> needs a Wait>

Post by JRL » Thu May 29, 2014 8:50 pm

Never seen anything like this before.

I have a compiled script that gathers data from a database and puts the acquired data into a .csv file. The last line of the script then calls ExecuteFile> using the .csv file as the parameter which opens the data in excel. Works fine on about 10 computers. This morning a co-worker tells me that the program doesn't work on his computer. When I look into it I see that the csv file is created and is correct and that Excel opens. However, Excel does not display any data. The excel screen is blank, most of the menu items are even greyed out.

After fooling around with this for 20 minutes I discovered that if I put a short wait as the last line. Everything works as planned. Its as if the File is used to start Excel but doesn't get passed to Excel.

The oddest part is it only fails to work on one computer. The following script will fail on that one computer. Works fine if the Wait> is unremarked. The computer is running Windows 7 and Excel 2007.


Code: Select all

Let>CSVFile=%temp_dir%FileForTesting.csv
WriteLn>CSVFile,wres,Item1%comma%Item2%crlf%Item3%comma%Item4
ExecuteFile>CSVFile
//Wait>1

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Re: ExecuteFile> needs a Wait>

Post by Djek » Thu May 29, 2014 10:34 pm

strange,
I would place the wait between the writeln and then ExecuteFile
Putting the wait in the last line doesnt make sense to me.
Did you you check the temp folder? Maybe there are tons of files in it...
Over here (Win7 and excel2010 i cant reproduce your error.
kind regards
Djek

User avatar
JRL
Automation Wizard
Posts: 3524
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: ExecuteFile> needs a Wait>

Post by JRL » Fri May 30, 2014 4:23 am

I don't know why the number of files in the temp folder would matter but I'll check that anyway. I find I often don't understand why.

Thanks for testing.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts