Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I had a small subroutine where I read one text file and wrote to another. It
worked fine, but then I wanted to break the write (Print statement) out various subroutines. Now I am receiving error: Run-Time error '52': Bad File name or number Any thoughts on how to acomplish this? I want to open the input and output files in the main sub, and then read/write in various sub-routines. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() without seeing your code it's hard to give a specific answer If you use commands like this Print #1, "This is a test" ' Print text to file. you probally need a glabal variable to hold your free file number and then use that variable within each sub routine use this to get a free file numer dim iFF as integer iFF = FreeFile then use variable in command Print #myVariable, "This is a test" ' Print text to file. *-Post posted before response, posts merged!*- Oops typo in my previos reply Print #myVariable, "This is a test" ' Print text to file. should be Print #iFF, "This is a test" ' Print text to file. -- mudraker If my reply has assisted or failed to assist you I welcome your Feedback. www.thecodecage.com ------------------------------------------------------------------------ mudraker's Profile: http://www.thecodecage.com/forumz/member.php?userid=18 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=27096 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You would think I would know better. I sat here trying to execute just the
subroutine instead of the main sub. It is working correctly. Thanks for the qucik response though! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number Format on Excel File saved from .html file | Excel Discussion (Misc queries) | |||
How to tell number of spaces between values in saved text file fromthe original xls file | Excel Discussion (Misc queries) | |||
Count Number of Records and Number of Fields in CSV File | Excel Programming | |||
Open Test file with VBA with a changing file number | Excel Programming | |||
Create a batch file from a number of Excel File | Excel Programming |