Open a XLS from a Module

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
 
C

Colo

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
 
G

Guest

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
 
G

Guest

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
 
Top