Error 91-With not established

0

Why is this error in the code?

Dim FSO, folder, subFlds, fld, ParentFolder, path

Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
ParentFolder = oFSO.GetFile(ActiveWorkbook.FullName).ParentFolder.ParentFolder.path

path = ParentFolder + "\Base de Datos\"

Set FSO = CreateObject("Scripting.FileSystemObject")
Set folder = FSO.GetFolder(path)
Set subFlds = folder.SubFolders

For Each fld In subFlds
    List1.AddItem fld.Name
Next
    
asked by Kaiserdj 02.05.2018 в 19:32
source

1 answer

0

That error usually appears when you're working with objects and you want to make one object part of another or exactly the same.

may be because you are not using the word SET in a line of code like the following:

SET objetox = objetoy
    
answered by 16.05.2018 в 23:13