View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Help end the testing tedium please

The option buttons are the 60 blank little circles. When you select one of
these buttons it is running a macro that is using GetOpenFilename.

What you need to do is create a table of project numbers and filenames.
This can easily be done using an Array statement in VBA

Filenames = Array("Name1","Name2","Name3").

You could also have a base name for each file with a diffferent number added
for each input.

What you really need to do is to post the old code at this website because
you need a new macro. You can't just have a new macro call the old macro
because the method of selecting the filenames will be different.

I think from your description only minor changes will be needed, but it will
make the operation fully automatic.

"Dean" wrote:

I have an extremely complex template, its ancestry traced to another author,
that I need to test extensively, often, as I add features to it. It can
handle up to 60 projects and, when I test it, I would like to test it with
all 60 used. I will use 60 imported data files called "Project 1test.xls"
thru Project 60test.xls".



Presently, you have to repeat the same procedure to import and process the
60 files and, though it is simple and cute, for all 60 files, it is
dreadfully tedious, so much so that you can mess it up. So, I'd like some
help in automating the procedure.



Assume that a custom screen (a "form" in VB editor that is somehow populated
more) is presented. It already was designed by another long before I was
asked to augment the template. Here is the subsequent procedu



The "form" I am presented with has 60 little blank circles which say,
"Project 1" . thru "Project 60" beside them, respectively.



(1) I click on the blank circle beside Project 1 and it fills it in.

(2) Then I click on a rectangular button on that "form" that says "Select
File", which opens up a dialog box allowing me to manually navigate to and
choose an EXCEL data file for it to import.

(3) Once I find the right file, call it "Project 1test.xls" (assume it is
the default (last used) folder), I click the open button on that dialog box,
which causes it to import the file and do its business, and then the dialog
box goes away.

(4) Next, I click a rectangular button on the form titled "Consolidate".
About ten seconds later, it responds with "This project has been
successfully consolidated", leaving you with a dialog box upon which you
click OK.





Then, I would repeat the exact same procedure for Projects 2 thru 60 using
files named Project 2test.xls thru Project 60test.xls", all in the same
folder.



Can someone give me VB code that would cycle thru this for all 60 projects?



Thanks much!

Dean



PS For what it's worth, I tried recording the process of clicking on a
macro button to bring up the "form" and doing these 4 steps but all that was
recorded was:



Sub Macro3()
'
' Macro3 Macro
' Macro recorded 10/20/2007 by Dean


Application.Run "'CPT-10-19-07 DM-3.xls'!Load_Consolidate_Dialog"
End Sub