0
i have the following doubt, I want to use the code with the property Multiselect = True
which returns a Variant() as a result, however when I click "cancel" it returns False
, resulting in the following error:
Runtime error 13 "incompatible types".
Code below:
public sub open_file()
dim i as integer
Dim filename() As Variant
filename = Application.GetOpenFilename(Title:="Arquivos em Excel", MultiSelect:=True, FileFilter:="Arquivos em Excel,*.xls*")
For i = 1 To UBound(filename)
msgbox filename(i)
next i
end sub
Any idea how to fix this error?