jbesclapez
Active Member
- Joined
- Feb 6, 2010
- Messages
- 275
hi there,
I am trying to solve this error. It must be something stupid i do not see - I hope so.
The macro is stoping at the line If strTargetFile = "False" Then Exit Sub
I have no idea why
Thanks for your time
I am trying to solve this error. It must be something stupid i do not see - I hope so.
The macro is stoping at the line If strTargetFile = "False" Then Exit Sub
I have no idea why
VBA Code:
Sub Test()
Dim wb As Workbook
strTargetFile = Application.GetOpenFilename(FileFilter:="Excel Files (*.xml*), *.xml*", Title:="Choose File To Copy", MultiSelect:=False)
If strTargetFile = "False" Then Exit Sub
Set wb = Workbooks.OpenXML(Filename:=strTargetFile, LoadOption:=xlXmlLoadImportToList)
Application.DisplayAlerts = True
wb.Sheets(1).UsedRange.Copy ThisWorkbook.Sheets("Delete").Range("A1")
wb.Close False
End Sub
Thanks for your time