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!

Scheduler Macro Excel Format export 1

Status
Not open for further replies.

NEAR

Programmer
May 20, 2003
63
US
When I ececute a macro in Scheduler, exporting it to an Excel file, I noticed that the format was lost. If the same Impromptu report was "Saved As", the format remains as designed. Specific (Export with format) options seem to be unavailable. I know I can execute to same *.imr in scheduler directly without the need to execute a macro (works fine and preserves formats) but as a question, does anyone know if this can be accomplished through a marco in Scheduler.

Thanks
 
NEAR,
It's an oversight in Impromptu that has been corrected in 7.1 (Series 7, Version 2). Otherwise, the only way is to do a bodge with SENDKEYS along the lines of:
AppActivate &quot;Impromptu - [<report name>.imr]&quot;
SendKeys &quot;%F&quot;,100
SendKeys &quot;A&quot;,100
SendKeys &quot;{TAB}&quot;,100
SendKeys &quot;{DOWN 8}&quot;,100
SendKeys &quot;{ENTER}&quot;,100
SendKeys &quot;+{TAB}&quot;,100
SendKeys &quot;C:\stuff\data.xls&quot;,100
SendKeys &quot;{ENTER}&quot;,100
SendKeys &quot;{TAB}&quot;,100
SendKeys &quot;{ENTER}&quot;,100
the 100's are delay amounts - adjust as required.
HTH
lex
 
DrLex,

I used your send key reccomendation, but I am experiencing an issue where sometimes it saves over the document and sometimes it does not. Is there a way to work around this.

In other dialogs, D. Griffin suggests a 'Kill stmt&quot; ....would you be able to give me an example of a kill statement? I would need this to occur obviosly before the file is saved over.

Thanks in advance,

dalex
 
dalex,
the sendkeys routine is only necessary if you have impromptu prior to 7.1. Otherwise use the ExportExcelwithFormat command.
There is a KILL command - format KILL <path & file name>.
Since you can't KILL the file when it is open, why not just save the file in a different name/location, then use KILL prior to copying over?
You can use GETATTR to test whether the file exists prior to a KILL command - see the help file in the macroscript editor for an example.

lex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top