问题描述
您好到目前为止我已经按照您的代码示例使用MSAC(xls / xlsx)使用MDAC和Oledb。
我正试图从Excel 2010中的工作表中获取特定单元格中的数据,但它似乎给了我一些问题。这是我下面的代码
MyCommand =新OleDb.OleDbDataAdapter(_
select * from [&SheetList(6),& $ B4,MyConnection)
我知道必须有一个简单的修复,可能是一个不合适的支架。我非常感谢你能给我的任何帮助。谢谢:)
来源: []
其次,替换:
with:
MyCommand = 新 OleDb.OleDbCommand
Hello so far I followed your code example for Working with MS Excel(xls / xlsx) Using MDAC and Oledb.
I''m trying to get data from a specific cell from my worksheet in Excel 2010 however it seems to be giving me some issues. Here is my code below
MyCommand = New OleDb.OleDbDataAdapter( _
"select * from [" & SheetList(6), & "$B4", MyConnection)
I know there has to be a simple fix, maybe a bracket out of place or something. I greatly appreciate any help you may be able to give me. Thanks :)
Source: Accessing Microsoft Office Data from .NET Applications[^]
Secondly, replace:
with:
MyCommand = New OleDb.OleDbCommand
这篇关于将数据从Excel指定到VB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!