Então, eu fiz uma macro que permite buscar um endereço eu atribuo ele a uma variável chamada Text. Então eu gravei uma macro que faz importação de tabela, com as configurações do jeito que quero, então vem o problema, o endereço que essa macro tem que usar pra buscar a tabela, é o endereço que esta na variável, e não ta dando certo, sendo que quando eu compilo o programa, até o momento em que vai começar o Active, eu verifico, e ali em Text o programa confirma que há um valor na variável.o Problema é dentro da busca ali do Active mesmo.A mensagem de erro que da quando eu tento compilar o Active é : "invalid procedure call or argument" O que faço pra funcionar?? Sub Macro3()
Text = TextBox1.Value
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Text.Value", _
Destination:=Range("A1"))
.Name = "Table"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 7
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub