I'm using this code to open a text file. Is there a method to specify the size and location of the window that opens with the textfile?
I'm sure there may be a better method to open the textfile, so feel free to tell me how bad this code is.
Private Sub CommandButton2_Click()
On Error GoTo ErrHandler
Dim arr() As Variant, Pathh As String
Pathh = ""
i = 1
Do
ReDim Preserve arr(i)
holder = Split(Environ(i), "=")
If holder(0) = "HOME" Then Pathh = holder(1)
i = i + 1
Loop Until Environ(i) = ""
If Len(Pathh) > 0 Then
FileName = Pathh & "\ocean_def.txt"
End If
ActiveWorkbook.FollowHyperlink Address:=FileName, NewWindow:=True
Exit Sub
ErrHandler:
Msg = "The User Defaults File Was Not Found."
MsgBox (Msg), , "User Defaults File"
Exit Sub
End Sub
Excel 2000
Thanks for helping me.
Bookmarks