Thread: Error message
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Edward Ulle Edward Ulle is offline
external usenet poster
 
Posts: 92
Default Error message

Try this.

Sub GetDLoadFromSapStd()

Dim mySavedPath As String
' Dim Cancel As Variant ' Dont see where needed
mySavedPath = CurDir

ChDirNet "\\zadad01\sapinter\ZA-TM-RECON\DOWNLOAD"
' ========== Insert from here =======
TryAgain:
fileToOpen = Application.GetOpenFilename("Text Files (*.csv),*.csv")
If fileToOpen = "False" Then
If MsgBox("Do you want to cancel?", vbYesNo) = vbYes Then
ChDirNet mySavedPath
Exit Sub
Else
GoTo TryAgain
End If
End If
' ========== to here =========
mySapFile = fileToOpen
Workbooks.OpenText Filename:=mySapFile
ChDirNet mySavedPath
OptionCheckStd
' End If ' Dont see where needed
End Sub




*** Sent via Developersdex http://www.developersdex.com ***