Get data from an Excel file without importing the data to the data table
来源:互联网 发布:淘宝的云客服 编辑:程序博客网 时间:2024/05/23 11:36
Create an Excel object using VBScript
The function below will allow to you to extract data from an external Excel file (specifying the sheet) without importing the file to the QuickTest data table. The function uses automation objects to create an Excel object.
GetValueInFile (sfilePath, isheet, irow, icolumn)
sfilePathThe path and name of the excel file.isheetThe sheet of the excel file. This can be an index number or the sheet name.irowThe row number in the table.icolumnThe column number in the table.Function GetValueInFile (sfilePath, isheet, irow, icolumn)
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.Workbooks.Open sfilePath
Set NewSheet = ExcelObj.Sheets.Item(isheet)
value = NewSheet.Cells(irow,icolumn)
ExcelObj.Application.Quit
Set ExcelObj = Nothing
GetValueInFile = value
End Function
Example:
dim filename
filename = "D:\temp\Test.xls"
msgbox GetValueInFile(filename,1,2,2)
msgbox GetValueInFile(filename,"Sheet1",1,1)
msgbox GetValueInFile(filename,2,2,2)
msgbox GetValueInFile(filename,3,1,1)
0 0
- Get data from an Excel file without importing the data to the data table
- Write data to an Excel file without importing the data to the data table
- the data that is in the table is from excel, so the data to be read can changed?
- ERROR: unable to get the receiver data from the DB!
- Get the webpage data from URI.
- Moving Data from HDFS to Hive Using an External Table
- iOS ERROR: unable to get the receiver data from the DB 解决方案
- Use jQuery To Retrieve Data From An XML File
- Get Data from Database without definited Structure
- "Unable to get image data from canvas because the canvas has been tainted by cross-origin data"问题产生原
- Excel File to Oracle data.
- DataTables warning (table id = 'data-table-1'): Requested unknown parameter '9' from the data source
- How to Get the Frequency Table of a Categorical Variable as a Data Frame in R
- Export large data from GridView to Excel file using C#
- Export the table decribe from oracle data dictionary
- convert the Data from Table into Insert Sentence.
- Use Jquery to get json data from the server-side php page
- How to get the data from a cell when I click on the GridButtonColumn of the same row
- 黑马程序员--网络通讯
- Hibernate 批量处理
- 顺时针打印矩阵
- C#中动态执行代码,执行字符串中的代码
- FrameLayout 程序界面预加载
- Get data from an Excel file without importing the data to the data table
- UVALive 3263 That Nice Euler Circuit
- 初识java继承
- Python yield 使用浅析
- UML-用例图(1)
- mysql innodb 索引失效问题引起表级锁
- Cocos2d-x学习之windows 7 android环境搭建
- 【带删除并查集】FZU 2155——盟国
- TCP/IP学习之 TCP与UDP的 区别