![]() |
Write data in a closed file?
I want to make a Macro that reads data from a Workbook, and writes the data
in another group of Workbooks. I'd like that the destiny files remain closed while the macro is running. I tried to do with the open(instruction) but I have no luck. The macro can be done if I open all the Workbooks, but this way is not very comfortable. |
Write data in a closed file?
You need to open the workbook to put data into it.
Have a look at the follwing subroutine as an example. Sub tester() 'need a workbook called test1.xls in the c root. Dim w As Workbook Set w = Workbooks.Open("c:\test1.xls") w.Sheets(1).Range("A1") = "Hello, World" w.Close True End Sub -- Hope this helps Martin Fishlock, Bangkok, Thailand Please do not forget to rate this reply. "Nicolas" wrote: I want to make a Macro that reads data from a Workbook, and writes the data in another group of Workbooks. I'd like that the destiny files remain closed while the macro is running. I tried to do with the open(instruction) but I have no luck. The macro can be done if I open all the Workbooks, but this way is not very comfortable. |
All times are GMT +1. The time now is 12:00 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com