Ciao a tutti,
ottengo l'errore di runtime 5 sulla routine di cui sotto ... non riesco a capire da cosa dipenda.
Il codice si blocca alla riga 17, credo ci sia un errore nella scrittura di qualche variabile, ma non riesco a trovare dove.
Qualcuno ha il colpod'occhio che mi toglie da questo vicolo cieco?
codice:
rivate Sub CommandButton1_Click()
'
Dim address As String
Dim datoLab As String
Dim fil As String
Dim completa As String
address = Sheets("Importazione_dati").Cells(2, 2)
datoLab = Sheets("Importazione_dati").Cells(3, 2)
fil = datoLab & ".txt"
completa = address & "\" & fil
completa1 = "TEXT;" & completa
'
ActiveWorkbook.Worksheets.Add Before:=Sheets("Analisi")
ActiveSheet.Name = datoLab
With ActiveSheet.QueryTables.Add(Connection:=completa1, Destination:=Range("A1"))
.Name = datoLab
.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 = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 9, 9, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Sheets(datoLab).Range("A1:B14").Delete Shift:=xlUp
Sheets("Importazione_dati").Select
End Sub
Grazie milel in anticipo,
Fabio