Open a XLS from a Module

  • Thread starter Thread starter Giorgio
  • Start date Start date
G

Giorgio

Hi,
i need to open a xls file (located in the same
folder),from another xls file.
And, once i the file is open, how can i refer to the cells?

Thank you
regards
Giorgio
 
Giorgio said:
*Hi,
i need to open a xls file (located in the same
folder),from another xls file.
And, once i the file is open, how can i refer to the cells?

Thank you
regards
Giorgio *


Hello Giorgio, like this.


Code:
--------------------


Dim wb As Workbook
Set wb = _
Workbooks.Open(ThisWorkbook.Path & _
Application.PathSeparator & _
"YourBookName.xls") 'Change here to your Wkb name.
With wb
.Sheets("Sheet1").Cells(1, 1).Value = "Test"
End With
 
Put Workbooks.Open in your code and double click on Open
press F1 read the help and view the example.

Put Application.ActiveWorkbook.Cells(row, column).Value in
your code and double click on Cells press F1 read the help
and view the example.

regards
KM
 
Thankyou very much!
It works!
:)

-----Original Message-----



Hello Giorgio, like this.


Code:
--------------------


Dim wb As Workbook
Set wb = _
Workbooks.Open(ThisWorkbook.Path & _
Application.PathSeparator & _
"YourBookName.xls") 'Change here to your Wkb name.
With wb
.Sheets("Sheet1").Cells(1, 1).Value = "Test"
End With
 
Back
Top