Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Read txt file for input error handler

Hello,

I have a problem reading a text file. My VBA script calls a perl
script, VBA keep searching for a flag.txt so he don't go further with
the macro while perl is running.

What i want is that perl reports his errors in flag.txt (this is
working), and that VBA read the error as input for his error handler.

I have tried several thing but i can get it running. Have someone an
idea? what options do i have to use etc. etc. ??

Allready Thanks for your reply Chris

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Read txt file for input error handler

Hi Chris,

The following bit of code will open the file that is assigned to loopcnt.
It will then loop through every line in the txt file moving the data to a
seperate row on the worksheet.

You could modify this in order to read your error file maybe depending on
whether your error file contains 1 line or multiple lines.

Ta

Andi

Loopcnt = "c:\doc.txt"

Open Var_JrnlFile(Loopcnt) _

For Input As #Loopcnt

r = 0


Do Until EOF(Loopcnt) 'do until end of file #1 is reached

Line Input #Loopcnt, data


ActiveCell.Offset(r, 0) = data

r = r + 1


Loop


'MsgBox (Var_JrnlFile(Loopcnt))



Close #Loopcnt



"Chirs" wrote in message
oups.com...
Hello,

I have a problem reading a text file. My VBA script calls a perl
script, VBA keep searching for a flag.txt so he don't go further with
the macro while perl is running.

What i want is that perl reports his errors in flag.txt (this is
working), and that VBA read the error as input for his error handler.

I have tried several thing but i can get it running. Have someone an
idea? what options do i have to use etc. etc. ??

Allready Thanks for your reply Chris


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Read txt file for input error handler

Andi,

Thanks alot for your help this one works.

Chris

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
Error handler linto Excel Discussion (Misc queries) 1 February 11th 10 12:17 PM
Read Input file and highlight matches in excel Argus Rogue Excel Discussion (Misc queries) 1 May 17th 08 01:06 PM
Error Handler sharad Excel Discussion (Misc queries) 1 September 17th 07 06:38 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
Error Handler dht[_2_] Excel Programming 5 August 19th 04 08:51 AM


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