Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Read data from a text file (*.txt) | Excel Programming | |||
Put Excel data to text file???? | Excel Programming | |||
importing text file, removing data and outputting new text file | Excel Programming | |||
Open delimited text file to excel without changing data in that file | Excel Programming | |||
Get External Data, Import Text File, File name problem | Excel Programming |