G
Guest
Below is a macro I've cobbled together by reading Help Files and posts on
these message boards, as well as asking questions on these boards - thanks to
everyone who has provided help to date.
Basically, it writes a file path stored in a text file into a textbox, and
then shows a userform.
Is it possible to test this line to see if it returns an error:
Open "C:\Documents and Settings\TJ\Desktop\ThrowAway\DefaultPath.txt"
without using On Error GoTo?
I know I've been on the wrong track so far - I always get Compile Error
Expected: Expression.
Sub LoadTest()
Dim yPath As String
Dim ft As Object
Dim DefaultFolder2 As Object
On Error GoTo OpenBlank
If MultiSave.txtFldrPath.Text = "" Then
Open "C:\Documents and
Settings\TJ\Desktop\ThrowAway\DefaultPath.txt" For Input As #1
Do While Not EOF(1)
Input #1, yPath
Loop
MultiSave.txtFldrPath.Text = yPath
End If
MultiSave.Show
Exit Sub
OpenBlank:
MultiSave.txtFldrPath.Text = ""
MultiSave.Show
End Sub
Note: When I wrote that I cobbled this together, I meant it. So, any
suggestions are welcome.
I'm trying to write the code for a form that will allow me to save a file
into three places at the same time. I am trying to store a default location
for each of the three places in text files stored on a network drive.
Thanks,
these message boards, as well as asking questions on these boards - thanks to
everyone who has provided help to date.
Basically, it writes a file path stored in a text file into a textbox, and
then shows a userform.
Is it possible to test this line to see if it returns an error:
Open "C:\Documents and Settings\TJ\Desktop\ThrowAway\DefaultPath.txt"
without using On Error GoTo?
I know I've been on the wrong track so far - I always get Compile Error
Expected: Expression.
Sub LoadTest()
Dim yPath As String
Dim ft As Object
Dim DefaultFolder2 As Object
On Error GoTo OpenBlank
If MultiSave.txtFldrPath.Text = "" Then
Open "C:\Documents and
Settings\TJ\Desktop\ThrowAway\DefaultPath.txt" For Input As #1
Do While Not EOF(1)
Input #1, yPath
Loop
MultiSave.txtFldrPath.Text = yPath
End If
MultiSave.Show
Exit Sub
OpenBlank:
MultiSave.txtFldrPath.Text = ""
MultiSave.Show
End Sub
Note: When I wrote that I cobbled this together, I meant it. So, any
suggestions are welcome.
I'm trying to write the code for a form that will allow me to save a file
into three places at the same time. I am trying to store a default location
for each of the three places in text files stored on a network drive.
Thanks,
