Good morning all,
I have a very basic spreadsheet that opens multiple xml files from a flash drive and processes the data into a table. When I run the code I get a 438 error on the below highlighted code. This is a command I have used before with no issue but for some reason it is causing it to have a 438 error.
MsgBox "Insert the flash drive which contains the files to process and click Ok to proceed!"
myStrPath = "D:"
If myStrPath = "" Then GoTo ErrorCheck
Application.ScreenUpdating = False
Sheets("Import").Visable = True <----- Fails and gives a 438 error
Set myBWb = ThisWorkbook
RecCount = 1
ImportFile = Dir(myStrPath & "\*.xpf")
Do While ImportFile <> ""
Set myAWb = Workbooks.OpenXML(myStrPath & "" & ImportFile)
myAWb.Sheets(1).UsedRange.Copy myBWb.Sheets(1).Cells(RecCount, 1)
myAWb.Close False
Sheets("Import").Select
When doing through the development process I of course had all of this turned off for debugging but when I placed it back in the code I started getting the failure.
Thanks,
Tim
I have a very basic spreadsheet that opens multiple xml files from a flash drive and processes the data into a table. When I run the code I get a 438 error on the below highlighted code. This is a command I have used before with no issue but for some reason it is causing it to have a 438 error.
MsgBox "Insert the flash drive which contains the files to process and click Ok to proceed!"
myStrPath = "D:"
If myStrPath = "" Then GoTo ErrorCheck
Application.ScreenUpdating = False
Sheets("Import").Visable = True <----- Fails and gives a 438 error
Set myBWb = ThisWorkbook
RecCount = 1
ImportFile = Dir(myStrPath & "\*.xpf")
Do While ImportFile <> ""
Set myAWb = Workbooks.OpenXML(myStrPath & "" & ImportFile)
myAWb.Sheets(1).UsedRange.Copy myBWb.Sheets(1).Cells(RecCount, 1)
myAWb.Close False
Sheets("Import").Select
When doing through the development process I of course had all of this turned off for debugging but when I placed it back in the code I started getting the failure.
Thanks,
Tim