如何从excel电子表格vb.net导入数据? [英] How to Import data from excel spreadsheet vb.net?

查看:85
本文介绍了如何从excel电子表格vb.net导入数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我正在尝试从excel文件导入数据,但电子表格名称导致问题。如果我使用''Sheet1''作为我想要数据的电子表格的名称,那么它工作正常,但我想将电子表格的名称更改为具有''PROJECT SHEET''空格的名称。请指导

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

解决方案

请回复


< blockquote>你试过把它放在引号中吗?

""" PROJECT SHEET"""


你也可以尝试参考表格由其索引

表格(1)


感谢您的回复。引用工作,我尝试了很多东西 - 不同的括号,没有括号,更改名称,但没有尝试引号。它很有用,非常感谢你的帮助。


Hello
I am trying to import data from an excel file but the spreadsheet name is causing problem. If I use ''Sheet1'' as the name of the spreadsheet from which I want data, then it works fine but I want to change the name of the spreadsheet to the name which has spaces like ''PROJECT SHEET''. Please guide

Expand|Select|Wrap|Line Numbers

解决方案

Please reply


have you tried putting it in quotes?
"""PROJECT SHEET"""

you also might try referring to the sheet by its index
Sheets(1)


Thanks for your reply. Quotes work, I tried so many things - different brackets, no brackets, changing name but didn''t try quotes. It works, thank you so much for your help.


这篇关于如何从excel电子表格vb.net导入数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆