ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open a XLS from a Module (https://www.excelbanter.com/excel-programming/285629-open-xls-module.html)

Giorgio[_2_]

Open a XLS from a Module
 
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

Colo[_35_]

Open a XLS from a Module
 
Giorgio wrote:
*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


--------------------
;)


---
Message posted from http://www.ExcelForum.com/


No Name

Open a XLS from a Module
 
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

-----Original Message-----
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
.


No Name

Open a XLS from a Module
 
Thankyou very much!
It works!
:)


-----Original Message-----
Giorgio wrote:
*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


--------------------
;)


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com