Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbooks.open
I would like to open 4 files with a macro. If I just open one file it works.
If I try to open more than one, I get a subscript out of range error. Can you help me with this? Thanks! Workbooks.Open Sheets("files").Range("C3").Value Workbooks.Open Sheets("files").Range("C4").Value |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbooks.open
After the first workbooks.open, the opened workbook is the active
workbook, so your reference to Sheets("files").Range(..) is invalid unless the just opened workbook has a worksheet named "files". Try: With ThisWorkbook.Sheets("files") Workbooks.Open .Range("C3").Value Workbooks.Open .Range("C4").Value End With In article , Jim Cottrell wrote: I would like to open 4 files with a macro. If I just open one file it works. If I try to open more than one, I get a subscript out of range error. Can you help me with this? Thanks! Workbooks.Open Sheets("files").Range("C3").Value Workbooks.Open Sheets("files").Range("C4").Value |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbooks.open
That worked perfectly!
Thanks so much! "JE McGimpsey" wrote: After the first workbooks.open, the opened workbook is the active workbook, so your reference to Sheets("files").Range(..) is invalid unless the just opened workbook has a worksheet named "files". Try: With ThisWorkbook.Sheets("files") Workbooks.Open .Range("C3").Value Workbooks.Open .Range("C4").Value End With In article , Jim Cottrell wrote: I would like to open 4 files with a macro. If I just open one file it works. If I try to open more than one, I get a subscript out of range error. Can you help me with this? Thanks! Workbooks.Open Sheets("files").Range("C3").Value Workbooks.Open Sheets("files").Range("C4").Value |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
when i open an Excell file 3 workbooks open.Why? | Excel Discussion (Misc queries) | |||
When I open Excel, workbooks open automatically. How can I stop t | Excel Discussion (Misc queries) | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
Workbooks.Open closes other workbooks | Excel Programming | |||
Workbooks.Open / .Open Text - How do you stop the .xls addition? | Excel Programming |