Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Opening a list of workbooks

I have a list of workbooks in a worksheet that I'd like to open
automatically. How would I do that using VB?

Thanks,
Barb Reinhardt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Opening a list of workbooks

Dim bk() as Workbook
redim bk(0 to selection.count - 1)
i = 0
for each cell in selection
set bk(i) = Workbooks.Open(cell.Value)
Next


This assumes the cells contain the fully qualified path as well if it is
required to find the workbook.

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote in message
...
I have a list of workbooks in a worksheet that I'd like to open
automatically. How would I do that using VB?

Thanks,
Barb Reinhardt




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Opening a list of workbooks

What if I define the name DEFECT for the series, what would need to be
changed?

"Tom Ogilvy" wrote in message
...
Dim bk() as Workbook
redim bk(0 to selection.count - 1)
i = 0
for each cell in selection
set bk(i) = Workbooks.Open(cell.Value)
Next


This assumes the cells contain the fully qualified path as well if it is
required to find the workbook.

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote in message
...
I have a list of workbooks in a worksheet that I'd like to open
automatically. How would I do that using VB?

Thanks,
Barb Reinhardt






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Opening a list of workbooks

Dim rng as Range
Dim bk() as Workbook
set rng = Range("Defect")
redim bk(0 to rng.count - 1)
i = 0
for each cell in rng
set bk(i) = Workbooks.Open(cell.Value)

Next



at some point
for i = lbound(bk) to ubound(bk)
bk(i).close SaveChanges:=False
Next


--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote in message
...
What if I define the name DEFECT for the series, what would need to be
changed?

"Tom Ogilvy" wrote in message
...
Dim bk() as Workbook
redim bk(0 to selection.count - 1)
i = 0
for each cell in selection
set bk(i) = Workbooks.Open(cell.Value)
Next


This assumes the cells contain the fully qualified path as well if it is
required to find the workbook.

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote in message
...
I have a list of workbooks in a worksheet that I'd like to open
automatically. How would I do that using VB?

Thanks,
Barb Reinhardt








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening new workbooks Falcon248 Excel Discussion (Misc queries) 0 January 22nd 10 07:09 PM
Opening Multiple Workbooks SJT Excel Discussion (Misc queries) 1 June 6th 06 06:32 PM
Opening workbooks calimari Excel Discussion (Misc queries) 2 January 24th 06 12:34 AM
opening workbooks on startup Julian Campbell Excel Discussion (Misc queries) 2 August 5th 05 12:28 AM
Opening Workbooks Mininmized DME New Users to Excel 1 December 1st 04 06:53 PM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"