alexdaman
03-24-2003, 12:41 PM
Hi all!
Simple question:
What do I have to do to open a SECOND excel file?
---
Dim xlap As New excel.Application 'Opens 1 excel appl.
sub open_excelfile()
xlap.Workbooks.Open "C:\file1.xcl" 'Open's 1st excel file
end sub
sub close_excelfile()
xlap.Workbooks.Close
xlap.Quit
Set xlap = Nothing
end sub
sub select_ragne()
xlap.Range("A1:A6").Select
end sub
---
If I declare a new object like:
Dim xlap_second As New excel.Application
it will start a new Excel, just for this second file
and this is a waste of memory.
Is it possible to open a NEW WORKBOOK?
I've seen that the property "Workbooks" has an index.
But I havent figured out how it works.
Thanks for any help!
Stay cool.
Simple question:
What do I have to do to open a SECOND excel file?
---
Dim xlap As New excel.Application 'Opens 1 excel appl.
sub open_excelfile()
xlap.Workbooks.Open "C:\file1.xcl" 'Open's 1st excel file
end sub
sub close_excelfile()
xlap.Workbooks.Close
xlap.Quit
Set xlap = Nothing
end sub
sub select_ragne()
xlap.Range("A1:A6").Select
end sub
---
If I declare a new object like:
Dim xlap_second As New excel.Application
it will start a new Excel, just for this second file
and this is a waste of memory.
Is it possible to open a NEW WORKBOOK?
I've seen that the property "Workbooks" has an index.
But I havent figured out how it works.
Thanks for any help!
Stay cool.