Saving generated excel
Moderators: Dorian (MJT support), JRL
Saving generated excel
Hello everybody,
I've searched the topic yet could not find a solutions to my problem:
We're trying to save a generated excel file (generated by our accounting software) to a specific location.
Currently I've made a dialog to request the directory where the file should be saved to.
Getting the excel file from te software works, yet when trying to save the file there is only a part of the directory copied (last part) resulting in a failure to save seen the directory is incomplete.
Can anybody help me? I've attached the code, "varLocatie" is the name of the dialog part where the directory needs to be copied.
Thanks, Wout
I've searched the topic yet could not find a solutions to my problem:
We're trying to save a generated excel file (generated by our accounting software) to a specific location.
Currently I've made a dialog to request the directory where the file should be saved to.
Getting the excel file from te software works, yet when trying to save the file there is only a part of the directory copied (last part) resulting in a failure to save seen the directory is incomplete.
Can anybody help me? I've attached the code, "varLocatie" is the name of the dialog part where the directory needs to be copied.
Thanks, Wout
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Saving generated excel
I'm not 100% sure i follow, but let's see.
If I edit part of your script slightly, to make sure varLocatie is as it was entered, we see that all is as expected.
So is the issue that when you use Send>varLocatie in the last line of your script, it's not sending the entire string?
I'm assuming if it's typing something in the box, we can confirm focus is set.
If so, let's try slowing down the SendText, as maybe it's overwhelming i's target. Add this near the top of your script :
Let>SK_delay=150
It's fine to experiment with the values. 150 will pause for 150 milliseconds between keystrokes.
Or... Try using the FindObject Wizard to enter varLocatie wherever you want it to go.
If I edit part of your script slightly, to make sure varLocatie is as it was entered, we see that all is as expected.
Code: Select all
......
Else
MessageModal>User Cancelled
Endif
//MJT edit
MessageModal>varLocatie
exit
Press F12
Wait>0.1
SendText>Name file
.....
I'm assuming if it's typing something in the box, we can confirm focus is set.
If so, let's try slowing down the SendText, as maybe it's overwhelming i's target. Add this near the top of your script :
Let>SK_delay=150
It's fine to experiment with the values. 150 will pause for 150 milliseconds between keystrokes.
Or... Try using the FindObject Wizard to enter varLocatie wherever you want it to go.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Saving generated excel
Hi Dorian,
Thanks for the answer, it seems to be working now.
I've tested lowering the delay and ended up having the original problem.
Thanks!
Thanks for the answer, it seems to be working now.
I've tested lowering the delay and ended up having the original problem.
Thanks!
Re: Saving generated excel
Dear,
It works!
Seems like time was indeed all we needed..
Thanks!
It works!
Seems like time was indeed all we needed..
Thanks!
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Saving generated excel
Excellent! Great to hear. Thank you for the feedback.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Saving generated excel
Great, I've managed to do so based on that thread, it helps me A LOT! I've got to prepare investment scenarios for almost a German commercial real estate, so there's a lot of Excel generation to do, and Macro Scheduler turns it into a human-sized task, fortunately enough.
Re: Saving generated excel
Is there a way to work around the TAB portion to go to the directory to save the document?
It seems that every first time I need 11 x tab, yet second time I run the script it's 12x tab.
The saving directory is asked for in the dialog, file name doesn't necessarily need to change..
Thanks!
It seems that every first time I need 11 x tab, yet second time I run the script it's 12x tab.
The saving directory is asked for in the dialog, file name doesn't necessarily need to change..
Thanks!
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Saving generated excel
Use VBA for saving, that way is solid.
Re: Saving generated excel
I'm not currently still learning everything and not very skilled so far.
Have you got an example or a link to a tutorial of some kind?
Thanks W.
Have you got an example or a link to a tutorial of some kind?
Thanks W.
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Saving generated excel
If you record s macro within Excel where you have the file you can look it through and convert it to code to use with Macro Scheduler