Jump to content
Macro Express Forums

will ME/MEpro loop for all files {do macro)


Recommended Posts

Ok, so here's my situation. My boss bought this excel addin that asks for a filename, and then after you type in the filename a dialog box opens that allows many choices. Drop down lists to choose items, radio buttons, checkboxes, etc, and then a submit button. you pick all the options you want, and then submit it, wait a few seconds, and the spreadsheet is filled. I then save the spreadsheet based on the name of the file used, concatenating "_processed.xls" to the filename (and stripping the old extension off of it.) So for example if the data file is "test_run.dat" the processed file is saved as "test_run_processed.xls"

 

First question, Macro expresss [pro] can script this all up with a record and save as macro ability correct?

 

Next question. Now that I have a macro to process a specific file, I want to remove all references to that specific file (in the example "test_run.dat") and have ME prompt the user for a directory, and have ME loop through all the files in that directory applying each of the filenames to the macro. Is this level of control in scope for ME??

 

TIA,

 

Jleslie48

Link to comment
Share on other sites

Your first question is worded poorly and I’m not sure what you mean. But given your explanation it’s very likely it can be done with MEP.

 

Again the second question is worded oddly but I think I get the gist of it and the answer is ‘yes’.

Link to comment
Share on other sites

If I understand you correctly, all that you describe can be done with ME. If you create the initial macro by recording and saving your manual process, try to fill in the check boxes and dropdowns via keyboard rather than mouse action -- easier to edit later, and less susceptible to changes in the screen resolution or variations from one PC to another. After recording and saving, you will wind up with a macro that will need some (lots of?) editing with the script editor, and you will also need the script editor to add the folder processing. Once you have worked with the editor a bit you will rarely, if ever, create a macro by recording your keystrokes -- it's just easier in the long run to build it from scratch with the editor.

Link to comment
Share on other sites

If I understand you correctly, all that you describe can be done with ME. If you create the initial macro by recording and saving your manual process, try to fill in the check boxes and dropdowns via keyboard rather than mouse action -- easier to edit later, and less susceptible to changes in the screen resolution or variations from one PC to another. After recording and saving, you will wind up with a macro that will need some (lots of?) editing with the script editor, and you will also need the script editor to add the folder processing. Once you have worked with the editor a bit you will rarely, if ever, create a macro by recording your keystrokes -- it's just easier in the long run to build it from scratch with the editor.

 

Thanks everybody for your responses. rberg, despite my butchering of the english language, you've got my issue well understood. What you've explained is exactly how I *hoped* ME would work. I realize that the more I "program" keystrokes vs mouse movements the far better off I'll be in the long run. Alas I'm required to automate a VB Script that was very poorly written and many of required human interface commands are mouse only. Even something like ^A to hi-light all the choices of the selection box is not programmed, and it also does not remember the settings of radio buttons, check boxes, etc when I re-run the VB script.

 

So my attack plan is so:

 

1) use the recording and saving feature of ME to save off a script and make sure it actually does all the button pushes and jumps through all the hoops of my user application.

 

2) analyze the script in script editor and learn the translation of "human clicking and typing" to ME's scripting language. If I used keystrokes liberally in my original recording of the macro, I should see these more clearly in the script and I can use them as beacons.

 

3) I can either save off this macro as an independent macro or some kind of procedure/function in ME.

 

4) I need to develop a wrapper macro that will prompt me for the directory that I want to process, pick out the files in that directory one by one and apply that filename to the procedure/macro defined in step 3) above. I've been reading up, it seems this involves the "repeat with folder" command, and a %t1% variable although I'm not clear how the %t1% variable gets associated with the "repeat with folder" command. I imagine that the procedure from step 3) will allow me use the %t1% parameter in the section where I need to type in the filename for the VB script.

 

Thanks again for all the input, and I hope you folks won't mind a few follow-up questions as I try this stuff out.

 

sincerely

 

jleslie48

Link to comment
Share on other sites

Ok, so here's my situation. My boss bought this excel addin that asks for a filename, and then after you type in the filename a dialog box opens that allows many choices. Drop down lists to choose items, radio buttons, checkboxes, etc, and then a submit button. you pick all the options you want, and then submit it, wait a few seconds, and the spreadsheet is filled. I then save the spreadsheet based on the name of the file used, concatenating "_processed.xls" to the filename (and stripping the old extension off of it.) So for example if the data file is "test_run.dat" the processed file is saved as "test_run_processed.xls"

 

First question, Macro expresss [pro] can script this all up with a record and save as macro ability correct?

You will not be able to batch up all your responses and have them fed to Excel one by one. For example, assume 3 questions, each of which requires a Y or N answer. You can't supply a script containing Y, N, Y and expect that to work.

MEP will need to recognize a question and then respond accordingly. In order to recognize a question, MEP will need to "see" a window containing that question (i.e. a window named "Enter response" appears [which MEP can probably recognize]; then MEP needs to position itself on the Y or N response button and press it - or type Y or N into the appropriate text box, followed by Enter. I say "probably" because MDI windows, e.g. MS Access, tend not to work well).

 

Now MEP will need to recognize the next question or input form, etc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...