I have two macros that use the following method to open and write files:
They both write to different files and reference two different sessions.I want them both to run at the same time but when I start one and then try to run the other the first macro stops,fails with the error:"Bad file name or number.Line 212.Stopping macro playback."I have tried to make sure that the file number it is addressing is different by manually setting outF to a static number,even writing a routine to randomly pick a number between 1 and 99 and assigning it to outF to make sure they are not addressing the same file but it keeps erroring at the line 212 which is the "print #outF, HEADER" line.
Code:
outF = freefile
open Reports_Dir & SUBDIR & OFILE for output as #outF
print #outF, HEADER
print #outF, chr(34) & _
header1 & c & header2 & c & chr(34)
close outF
They both write to different files and reference two different sessions.I want them both to run at the same time but when I start one and then try to run the other the first macro stops,fails with the error:"Bad file name or number.Line 212.Stopping macro playback."I have tried to make sure that the file number it is addressing is different by manually setting outF to a static number,even writing a routine to randomly pick a number between 1 and 99 and assigning it to outF to make sure they are not addressing the same file but it keeps erroring at the line 212 which is the "print #outF, HEADER" line.