Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract Certain Data from closed file joecrabtree Excel Programming 2 November 30th 06 04:22 PM
How do I copy data from a closed file. Rob Moore Excel Programming 4 August 26th 06 01:20 PM
How to write to the VBE of a closed workbook? DaveO Excel Programming 2 July 4th 06 11:34 AM
Write no closed workbook ? MAS Excel Programming 2 July 31st 04 04:39 PM
Write to Array from other closed Excel file Dave B[_4_] Excel Programming 5 October 1st 03 04:48 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"