Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
P P is offline
external usenet poster
 
Posts: 1
Default Add data to a text file

Hello Experts,

I am interested to write contents of excel worksheet to a system file.

From MSDN i fould reference to filesystemobject in VBScript. But i am not
able to access "fileSystemObject" in Excel.

Any solution.

I would like to append to a log.txt to reflect the usage of the excel
Workseet and a a snapshot of performed taks.


--
Purnank



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Add data to a text file

Here is some sample code previously posted by Patrick Malloy

Private Sub WriteLog()
' trap error in case network not available
On Error GoTo trap
Dim log As String ' for the text to send to the log file
Dim ff As Long ' for the link to the text file
ff = FreeFile ' get a free file chammel
' create the text for the log
log = Format(Date, "ddd dd-mmm-yyyy") & " BookX opened as "
If ThisWorkbook.ReadOnly Then
log = log & "Read Only."
Else
log = log & "Read Write."
End If
' open the file for append
'note: if the file doesn't exist then it will be created automatically
Open "X:\LogFolder\THISBOOK_LOG.TXT" For Append As ff
' send the text to the log file
Print #ff, log
' then close it
Close #ff

trap: Err.Clear


End Sub


--

Regards,

Tom Ogilvy



"P" wrote in message
...
Hello Experts,

I am interested to write contents of excel worksheet to a system file.

From MSDN i fould reference to filesystemobject in VBScript. But i am not
able to access "fileSystemObject" in Excel.

Any solution.

I would like to append to a log.txt to reflect the usage of the excel
Workseet and a a snapshot of performed taks.


--
Purnank





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
Read data from a text file (*.txt) Adrian T Excel Programming 0 June 4th 04 10:00 PM
Put Excel data to text file???? bretweir Excel Programming 1 April 13th 04 06:54 PM
importing text file, removing data and outputting new text file Pal Excel Programming 8 February 27th 04 08:32 PM
Open delimited text file to excel without changing data in that file zohanc Excel Programming 1 October 3rd 03 01:06 AM
Get External Data, Import Text File, File name problem Scott Riddle Excel Programming 1 July 11th 03 05:40 PM


All times are GMT +1. The time now is 11:36 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"