在TextToColumns中正确设置FieldInfo时,不应该将文本转换为MS Access的文本?

您好,我遍历Excel工作簿中的所有列和TextToColumns'ing它们,以便MS Access将它们作为我想要的数据types; 然而,它似乎并没有为一个应该是简短的文本领域工作。

有问题的领域有字段名称“testing”,然后10个空白单元格,然后在第11 – 13行的文本“testing”,然后再次空白等,即大量的空白单元格和一些简短的文本string。

With w.sheet("x") 'I go through some logic to set variables c to a column number and 'iFormatType to either 2 for text, which is what I use for the "test" field, or 1 for general .Columns(c).TextToColumns Destination:=.Cells(1, r.Column), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=False, _ FieldInfo:=Array(1, iFormatType), TrailingMinusNumbers:=True end with 

正如在评论iFormatType = 2的字段“testing”中提到的,当我通过它。

稍后,我将工作簿导入到MS Access中,如下所示:

 DoCmd.TransferSpreadsheet acImport, , "tbl_DatedModel_" & sSomeVariableHere, "some file path here", True 

字段“testing”应该是一个文本字段,它是一个双。 我究竟做错了什么? 或者这只是一个限制,我应该转移到使用Schema.ini文件(我没有使用)?

我也尝试过通过MS Access Ribbon控件手动导入它,并得到相同的结果。

这里是一个相关的问题更多的背景: vba Excel到Access:零长度string为空数字