PDA

View Full Version : Read-Write Message Text files



tilamok
11-01-2008, 05:34 AM
Hello ALL

I have a little problem and I would appreciate any help, suggestions...:help

I have a software A that produces a log file. This log file give details of errors or how far the process has run.

I'm using Excel to import the log file using Workbook.opentext. I import the log file at various intervals to check the status of A. All this work well.

Unfortunately, once software A has finished its process, a message appears in Excel stating that the log file is now available for editing.

My understanding of what's happening is that:
While software A is running, the log file is readonly.
When I import the log file in Excel, Excel sees the file as readonly and stores an event. This event will activate the message "File is available for editing" once the log file is no longer readonly.

So how do I stop this message "File is available for editing" from appearing?:banghead:

Many Thanks

GTO
11-01-2008, 05:49 AM
Greetings and Salutations,

Since it appears that you joined in like the last three seconds (!), let me be the first to say Welcome. You will meet some very nice folks here :-)

As to your question, I haven't run into this, but was wondering:
When you say you import at intervals to check status, are you visually seeing the results of the log file, or programatically using the results of one or more records while processing? If the second, have you tried reading it thru FSO? just a quick (not thought thru) idea...

Mark

tilamok
11-01-2008, 05:59 AM
Greetings and Salutations,

Since it appears that you joined in like the last three seconds (!), let me be the first to say Welcome. You will meet some very nice folks here :-)

As to your question, I haven't run into this, but was wondering:
When you say you import at intervals to check status, are you visually seeing the results of the log file, or programatically using the results of one or more records while processing? If the second, have you tried reading it thru FSO? just a quick (not thought thru) idea...

Mark

Thanks for your very warm welcome.

When I import at various intervals, I mean visually i.e I run the excel opentext method that opens the log file in Excel without delimiters, copies col A and then pastes it in another spreadsheet. Then the macro closes the log file.

GTO
11-01-2008, 06:45 AM
You are most welcome, and I was not over stating the efforts that many of the members will make to assist. That said, our biggest "current" issue would be yours truly.

While it appears that you are but a couple hours earlier than me, I are shutting down while hopefully you are enjoying a nice Saturday morn.

Now by the time I hit the send bttn, you may get lucky (considering its the weekend and all) as I noted a couple of very learned folks signed on.

In the meantime, I would respectfully suggest taking a look at the help files, for topics: FileSystemObject, TextStream, etc. Basically, I think (as in not sure, but believe) you might be able to read the column w/o opening the log; thus avoiding the "Hi, I'm ready now" msg...

I'll check back later, so please mark resolved if that does the trick, or I'll try and stir up my rusty brain cells :-)

Nice to "meet",

Mark

tilamok
11-01-2008, 07:57 AM
I think that I've found an easy way to solve that problem.

I found out that you can set the Notify argument in workbook.open.

So I'll switch my code from using workbook.opentext to workbook.open and then set the notify argument.:doh:

Cheers

GTO
11-01-2008, 08:26 AM
Well thank you for that, as it was something I did not know either. Will definitely look it up later :-)

Mark (evidently AKA 'Insomniac')