Open a log file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a script that runs with in side of excel. If there are errors it writes them to a a text file that is named file.log. I want to open this log file at the end of the script but I can't seem to get it to work. Any help would be great thank
 
Jim,

Try using the Shell command to open Notepad.


Shell "notepad.exe c:\temp\test.log", vbNormalFocus


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


Jim said:
I have a script that runs with in side of excel. If there are
errors it writes them to a a text file that is named file.log. I
want to open this log file at the end of the script but I can't
seem to get it to work. Any help would be great thanks
 
What do you mean by open it? Do you want to open it in a spreadsheet
(workbooks.Open ). Do you want to open it in Notepad (use the shell
command)?

--
Regards,
Tom Ogilvy

Jim said:
I have a script that runs with in side of excel. If there are errors it
writes them to a a text file that is named file.log. I want to open this log
file at the end of the script but I can't seem to get it to work. Any help
would be great thanks
 
This file might be a help:
http://www.bygsoftware.com/examples/zipfiles/log_file.zip
It shows how to create a log file for your projects as you work. Add this
into your code while debugging, or use it in projects to audit user
activity.

It's in the "Administration Utilities" section on page:
http://www.bygsoftware.com/examples/examples.htm

The code is open and commented.


--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



Jim said:
I have a script that runs with in side of excel. If there are errors it
writes them to a a text file that is named file.log. I want to open this log
file at the end of the script but I can't seem to get it to work. Any help
would be great thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top