2015-10-30 3 views
1

Я смотрел на некоторых других с той же ошибкой, но их решение не помогает мне.Обновить BackgroundQuery: = False | нужна помощь?

Refresh BackgroundQuery:=False Ошибка 1004

Вот мой код

' 
' LoadData Macro 
' 

' 
With ActiveSheet.QueryTables.Add(Connection:= _ 
    "TEXT;Macintosh HD:Users:Karrar:Desktop:Excel.txt", Destination:=Range("A1")) 
    .Name = "Excel" 
    .FieldNames = True 
    .RowNumbers = False 
    .FillAdjacentFormulas = False 
    .RefreshOnFileOpen = False 
    .BackgroundQuery = False 
    .RefreshStyle = xlInsertDeleteCells 
    .SavePassword = False 
    .SaveData = True 
    .AdjustColumnWidth = False 
    .TextFilePromptOnRefresh = False 
    .TextFilePlatform = xlMacintosh 
    .TextFileStartRow = 1 
    .TextFileParseType = xlDelimited 
    .TextFileTextQualifier = xlTextQualifierDoubleQuote 
    .TextFileConsecutiveDelimiter = True 
    .TextFileTabDelimiter = False 
    .TextFileSemicolonDelimiter = False 
    .TextFileCommaDelimiter = False 
    .TextFileSpaceDelimiter = True 
    .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) 
    .UseListObject = False 
    .Refresh BackgroundQuery:=False 
End With 
End Sub 

ответ

1

Попробуйте строку ниже

ActiveSheet.Range("A1").QueryTables(1).Refresh BackgroundQuery:=False 

или

ActiveSheet.QueryTables(1).Refresh BackgroundQuery:=False 
+0

Я пробовал это, но вместо этого на этот раз я получил ошибку 438, thnx. –

+0

Где вы получаете ошибку 438 – newjenn

+0

Я получаю ее, когда добавляю ActiveSheet.QueryTables (1) .Refresh BackgroundQuery: = False «Ошибка времени выполнения» 438 »« –

Смежные вопросы