Error Code 438

LordTim

New Member
Joined
May 29, 2019
Messages
13
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
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You've mis-spelled Visible.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top