M
mburkett
I have some code that shells out to a program, writes a pdf file and
then it is supposed to move the file from the programs default
location to a location specified in the macro. All of the code works
when I step through or if I add a pause of 1-2 seconds (Not currently
in the code below) but not in regular mode. I don't want to use the
wait statement because some of the files can take 20 seconds or more
to write and I don't want that long of a pause for smaller files. Can
anyone think why the file would not copy to the new location while
running the macro in regular mode? It writes the PDF to the default
location so the WEND loop is okay but it never copies the file over.
Thanks - Michael
Rem Run RMF report
FindIt = Dir("f:\axys3\pdf\" + filesavename + ".pdf")
If Not Len(FindIt) = 0 Then
Kill "f:\axys3\pdf\" + filesavename + ".pdf"
End If
If q4check < 4 Then
progID = Shell("f:\axys3\rep32.exe -mquarter -p" & ccm & " -u -s -vf -
t" & filesavename)
Else
If ccmdate > inceptcutoff Then
progID = Shell("f:\axys3\rep32.exe -mqtr_eoy2 -p" & ccm & " -u -s -vf -
t" & filesavename)
Else
progID = Shell("f:\axys3\rep32.exe -mqtr_eoy -p" & ccm & " -u -s -vf -
t" & filesavename)
End If
End If
Rem Application.Run macro:="rmffile"
FindIt = Dir("f:\axys3\pdf\" + filesavename + ".pdf")
While Len(FindIt) = 0
FindIt = Dir("f:\axys3\pdf\" + filesavename + ".pdf")
Wend
progID = Shell("command.com /Ccopy f:\axys3\pdf\" + filesavename +
".pdf f:\perf\reports\" + perffolder)
FindIt = Dir("f:\perf\reports\" + perffolder + "\" + filesavename +
".pdf")
While Len(FindIt) = 0
FindIt = Dir("f:\perf\reports\" + perffolder + "\" + filesavename +
".pdf")
Wend
then it is supposed to move the file from the programs default
location to a location specified in the macro. All of the code works
when I step through or if I add a pause of 1-2 seconds (Not currently
in the code below) but not in regular mode. I don't want to use the
wait statement because some of the files can take 20 seconds or more
to write and I don't want that long of a pause for smaller files. Can
anyone think why the file would not copy to the new location while
running the macro in regular mode? It writes the PDF to the default
location so the WEND loop is okay but it never copies the file over.
Thanks - Michael
Rem Run RMF report
FindIt = Dir("f:\axys3\pdf\" + filesavename + ".pdf")
If Not Len(FindIt) = 0 Then
Kill "f:\axys3\pdf\" + filesavename + ".pdf"
End If
If q4check < 4 Then
progID = Shell("f:\axys3\rep32.exe -mquarter -p" & ccm & " -u -s -vf -
t" & filesavename)
Else
If ccmdate > inceptcutoff Then
progID = Shell("f:\axys3\rep32.exe -mqtr_eoy2 -p" & ccm & " -u -s -vf -
t" & filesavename)
Else
progID = Shell("f:\axys3\rep32.exe -mqtr_eoy -p" & ccm & " -u -s -vf -
t" & filesavename)
End If
End If
Rem Application.Run macro:="rmffile"
FindIt = Dir("f:\axys3\pdf\" + filesavename + ".pdf")
While Len(FindIt) = 0
FindIt = Dir("f:\axys3\pdf\" + filesavename + ".pdf")
Wend
progID = Shell("command.com /Ccopy f:\axys3\pdf\" + filesavename +
".pdf f:\perf\reports\" + perffolder)
FindIt = Dir("f:\perf\reports\" + perffolder + "\" + filesavename +
".pdf")
While Len(FindIt) = 0
FindIt = Dir("f:\perf\reports\" + perffolder + "\" + filesavename +
".pdf")
Wend