Excel Open and Close multiple Excel Workbooks In Backround with VBA

Joined
Aug 7, 2008
Messages
5
Reaction score
0
I am trying to open and close serveral Excel workbooks in the backround to be able to copy sheets selected by the user into a current workbook the user is in. Here is the code I use to open the workbooks:

Set ExceltabAP = New Excel.Application

For i = 1 To SeriesCount
SeriesName = ActiveCell.Value
If SeriesName <> "" Then
Set ExceltabWB = ExceltabAP.Workbooks.Open(CSht_DESeedFilePath & SeriesName & ".xls")
ActiveCell.Offset(1, 0).Select
Else
Exit Sub
End If
Next i

This will open 12 workbooks to be used to populate a multipage form and from there the user picks the sheets they want to copy to their current workbook. I need the code to close the 12 workbooks that I opened in the backround when the user is done.

Please help!
Thanks in advance.
Clint
 
Last edited:
What is it supposed to take me to? When I click on the 'here' in the forum write up, it takes me to a Google webpage search. The link that was in an email that was sent to me when you responded still sends me to a broken web link also.
 
I think so by actually just closing the application itself but that isn't what I was trying to accomplish. I am trying to select a workbook that is only open within the Excel applicaiton in the backround. There is no front end to work with. The purpose is to open up several workbooks, copy template pages out of them, and close them without the user ever seeing the workbooks the templates are pulled from.
 
Back
Top