Craig_the_pumpkin
Member
I'm still relatively new to InTouch so please excuse my ignorance.
What I'm trying to do is print an excel sheet. When I looked up the manual it seems that the right approach is
1. Open Excel File
2. Send a print instruction to excel
3. Close the Excel file.
To do this I'm using the following code
_______________________________________________________________
{Open Excel}
StartApp "C:\Program Files\Microsoft Office\Office 12\Excel.exe C:\Drum...csv;
{Print}
SendKeys "^(p)";
SendKeys "{ENTER}";
{Close Excel}
App_Title = InfoAppActive("EXCEL")
App_Active = InfoAppActive(App_Title);
WWControl(App_Title, "Close");
_______________________________________________________________
The issue that I'm hitting is that the excel file is not closing.
During my testing to try to fix this issue I found that:-
1. When I run the script once the App_Title is blank and the App_Active is No
2. If I run the script twice it closes the first excel spread sheet when the script is run the second time. (And App_Title changes to "Microsoft Excel..." and AppActive is set to YES)
My suspicion from this is that Excel is busy doing stuff when the close instruction is sent and therefore it just ignores it.
Does this sound possible/likely to be the issue?
Is there a way to add a delay or pause into an InTouch script so that it will wait a few seconds to allow excel to open fully before it tries to close it again?
Is there another way to achieve this same result that may not encounter this issue?
Any help would be appreciated.
Thanks,
Craig
What I'm trying to do is print an excel sheet. When I looked up the manual it seems that the right approach is
1. Open Excel File
2. Send a print instruction to excel
3. Close the Excel file.
To do this I'm using the following code
_______________________________________________________________
{Open Excel}
StartApp "C:\Program Files\Microsoft Office\Office 12\Excel.exe C:\Drum...csv;
{Print}
SendKeys "^(p)";
SendKeys "{ENTER}";
{Close Excel}
App_Title = InfoAppActive("EXCEL")
App_Active = InfoAppActive(App_Title);
WWControl(App_Title, "Close");
_______________________________________________________________
The issue that I'm hitting is that the excel file is not closing.
During my testing to try to fix this issue I found that:-
1. When I run the script once the App_Title is blank and the App_Active is No
2. If I run the script twice it closes the first excel spread sheet when the script is run the second time. (And App_Title changes to "Microsoft Excel..." and AppActive is set to YES)
My suspicion from this is that Excel is busy doing stuff when the close instruction is sent and therefore it just ignores it.
Does this sound possible/likely to be the issue?
Is there a way to add a delay or pause into an InTouch script so that it will wait a few seconds to allow excel to open fully before it tries to close it again?
Is there another way to achieve this same result that may not encounter this issue?
Any help would be appreciated.
Thanks,
Craig