Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andi,
Thanks alot for your help this one works. Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error handler | Excel Discussion (Misc queries) | |||
Read Input file and highlight matches in excel | Excel Discussion (Misc queries) | |||
Error Handler | Excel Discussion (Misc queries) | |||
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. | Charts and Charting in Excel | |||
Error Handler | Excel Programming |