Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default On opening an excel file

pcor,

One way.....
Original code from John Walkenbach

Open ThisWorkbook.Path & "\Logs\GB.log" For Append As #1
Print #1, Application.UserName, Now, "Opened"
Close #1

The above explained (modify at will):
1st Line - Opens a text file named GB.log in a subdirectory named
"Logs" underneath the current directory that the workbook was saved in.
2nd Line - Append the UserName, Date & Time and the comment "Opened"
to the GB.log file
3rd Line - close and save the GB.log file.

Notes....
The directory or subdirectory that you're creating the file in must exist
but the file itself doesn't have to exist (it will be vreated the first time
and appended to each subsequent time).
Place the above code in the Workbook_Open Event or in a regular module
and name the sub Auto_Open().

John

pcor wrote:

I want the program to write the date and time to a file on disk everytime
this Excel file is opened.
Help please.

--
Norton Virus checker 2003 says this email is clean


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
Resolve Error in opening Excel File zip file from a CD? rw5400 Excel Discussion (Misc queries) 1 March 17th 10 04:41 PM
opening a file in Excel starts application but dose not open file Bob Shelton Excel Discussion (Misc queries) 1 July 2nd 08 07:51 PM
Opening file in Excel 2003 opens multipule instances of same file Ed_B Excel Discussion (Misc queries) 1 June 21st 07 07:10 PM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 06:52 PM
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. Tim Marsden Charts and Charting in Excel 2 October 15th 05 02:10 PM


All times are GMT +1. The time now is 01:06 PM.

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"