vba - VB Script FileSystemObject methods throwing 424 error -
I have been searching the internet for the last few hours, because it always throws a 424 object essential error excel. Someone can explain why this is, and is the best way to fix it?
sub import XML () '' Import XML macro '' keyboard shortcut: set the Ctrl + K Dimume as integer FSO = CreateObject ("Scripting.FileSystem Object") ShowSubFolders FSO Show folder method sub subscript folders (folder) folder ("C: \ Users \ xxx \ desktop \ yyyyy \") End sub
For each subfolder in the .FolderSupfler subfolderSubstuffs subfolders next closing sub
F Get Ilen Method
sub getFiles (folder) for each file in the folder. The files 'ActiveSheet.Cells (1, 1) .Value = FSO.GetFileName (file)' throws here the next End Sub
ActiveSheet.Cells (1, 1) .Value = FSO.GetFileName (file)
object GetFileName (pathspec)
but if you are passing object
ActiveSheet.Cells (1, 1). Value = FSO.GetFileName (file.name)
or more direct
ActiveSheet.Cells (1, 1) .Value = dfile.name
Comments
Post a Comment