Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I´ve got some problems when I try to use QueryTables.Add on a sheet tha
I previously has created with : Worksheets.Add(After:=Worksheets(Worksheets.Count) ) I get the error Run-Time error '5' I have tried both: With ActiveSheet.QueryTables.Add........... and With Sheets(MyBacklogname).QueryTables.Add...... Code: MyBacklogname = "Outfile_B" & Sheets("Parametrar").Cells(7, 2).Value "_backlog" Set oSheet = Worksheets.Add(After:=Worksheets(Worksheets.Count) ) With oSheet .Name = MyBacklogname End With Sheets(MyBacklogname).Activate Sheets(MyBacklogname).Select MyConnection = "TEXT;" & ActiveWorkbook.Path & "\" & MyBacklognam & ".txt" With ActiveSheet.QueryTables.Add(Connection:=MyConnecti on Destination:=Range("D2")) .Name = "Outfile_Pplan" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = xlWindows .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False '.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1 1) .Refresh BackgroundQuery:=False End With \Someone help me : -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
QueryTables Error | Excel Programming | |||
QueryTables Error | Excel Programming | |||
Using Add Method of QueryTables gives error | Excel Programming | |||
With ActiveSheet.QueryTables.Add | Excel Programming |