Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default using a workbook to open more workbooks with filenames stored in cells

hello
i am having issues using VBA code for opening up workbooks within a
workbook.
i need to open up 6 other workbooks when the master workbook is opened.
i was playing around with some code i found on this group and i got 1
to work, but then when it tried to open the second one it said error
1004 cannot open " or something like that.
i have filenames of the workbooks i need to open stored in cells.
i know i'm supposed to use some form of Workbooks.Open code in this
somewhere, but thats about all i've got down, minus referencing the
cells.
sorry i'm a newb but we all have to start somewhere.
anyone have any ideas for this code? for opening multiple workbooks?

thanks in advance!
aaron ward

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default using a workbook to open more workbooks with filenames stored in cells

oh i forgot to mention,
there is a possibility that the files the workbook will be looking for
to open will not have been created yet. is there an if does not exist
function or something i could use?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default using a workbook to open more workbooks with filenames stored in cells

Private Sub Workbook_Open()
With Worksheets("Sheet1")
Workbooks.Open Filename:=.Range("A1").Value
Workbooks.Open Filename:=.Range("A2").Value
Workbooks.Open Filename:=.Range("A3").Value
'etc.
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


wrote in message
ups.com...
hello
i am having issues using VBA code for opening up workbooks within a
workbook.
i need to open up 6 other workbooks when the master workbook is opened.
i was playing around with some code i found on this group and i got 1
to work, but then when it tried to open the second one it said error
1004 cannot open " or something like that.
i have filenames of the workbooks i need to open stored in cells.
i know i'm supposed to use some form of Workbooks.Open code in this
somewhere, but thats about all i've got down, minus referencing the
cells.
sorry i'm a newb but we all have to start somewhere.
anyone have any ideas for this code? for opening multiple workbooks?

thanks in advance!
aaron ward



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default using a workbook to open more workbooks with filenames stored in cells

WOW! thanks bob, your code works great. thank you so much!

-aaron

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default using a workbook to open more workbooks with filenames stored in cells

do you know of any code off the top of your head that once all the
spreadsheets are open returns the vieable workspace to the original
spreadsheet?

-aaron



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default using a workbook to open more workbooks with filenames stored in cells

What exactly do you mean Aaron?

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


wrote in message
ps.com...
do you know of any code off the top of your head that once all the
spreadsheets are open returns the vieable workspace to the original
spreadsheet?

-aaron



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
Macro To consolidate All Open Workbooks Into One Workbook carl Excel Worksheet Functions 3 March 31st 07 04:22 AM
filenames and workbooks Sonnich Excel Programming 1 May 17th 06 07:54 PM
Open workbooks - filenames change daily GillianHG Excel Programming 2 November 17th 05 06:41 PM
How to automaticaly hide all toolbars in in workbook when another workbooks are open? Igor Sudnik Excel Programming 1 August 18th 04 09:05 PM
copy sheet1 from all open workbooks to one workbook Mike[_61_] Excel Programming 2 October 31st 03 02:16 PM


All times are GMT +1. The time now is 11:57 PM.

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

About Us

"It's about Microsoft Excel"