Excel VBA QueryTables.Add:停用日期转换

时间:2018-11-21 10:12:29

标签: excel vba excel-vba

不幸的是,尽管我在Google上搜索了很多:D

,但仍无法找到解决问题的方法。

我认为是一个问题,应该有一个简单的解决方案:

这是我的标准导入代码:

Private Sub Import(x)


Sheets("Buffer").Activate

    With ActiveSheet.QueryTables.Add(Connection:="URL;" & x, _
        Destination:=Range("A1"))
           ' .Name = "VPE"
            .FieldNames = False 'x
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = False 'x
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .WebSelectionType = xlEntirePage
            .WebFormatting = xlWebFormattingNone
            .WebPreFormattedTextToColumns = True
            .WebConsecutiveDelimitersAsOne = True
            .WebSingleBlockTextImport = False
            .WebDisableDateRecognition = False
            .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
     End With

结束字幕

我的问题是,我导入的文件(.htm)自动转换单元格。例如产品版本:6.0,6.08,6.48。 > Excel将其解释为日期,因此我无法再处理数据。我已经尝试过的:

  1. 将工作表“缓冲区”仅转换为文本/数字> excel将其覆盖
  2. 我参观了官方查询表对象网站(https://docs.microsoft.com/de-de/office/vba/api/excel.querytable) 但是我找不到正确的语句/标志
  3. 将定界符从“,”设置为“。”。

希望您能帮助我=)

致谢

弗洛里安

0 个答案:

没有答案