Simple VBScript program to extract data from all worksheets in an Excel spreadsheet

LibXL.for.Windows.3.6.5.0.Incl.License.and.Cracked LibXL is a library that can read and write Excel files. It doesn't require Microsoft Excel and .NET framework, combines an easy to use and powerful features. Library can be used to •Generate a new spreadsheet from scratch •Extract data from an existing spreadsheet •Edit an existing spreadsheet LibXL can help your applications in exporting and extracting data to/from Excel files with minimum effort. Also it can be used as report engine. Library can be used in C, C++, C#, Delphi, Fortran and other languages. Supports Excel 97-2003 binary formats (xls) and Excel 2007-2013 xml formats (xlsx/xlsm). Supports Unicode and 64-bit platforms. There are a wrapper for .NET developers and separate Linux, Mac and iOS editions. See features of the library in demo.xls or demo.xlsx files. 立即下载

Simple VBScript program to extract data from all worksheets in an Excel spreadsheet

by Greg Thatcher, MCSD, MCDBA, MCSE

The script below demonstrates how to extract all of the data from a Microsoft Excel spreadsheet. The script will extract data from all worksheets in a given Excel file. The script currently outputs all the data to a console window, though it can be easily modified to write the data to a file or database. In addition, this script can be converted to C++ by using the "VB-to-VC Automation Code Converter".

To run the script, save it to a file (e.g. excel.vbs). Modify the line that sets the excelPath variable, and change it to specify the location of your Excel file. For example, if your excel file was in the directory c:/StockData, and it's name was Cisco.xls, you would change the line to look like this:

excelPath = "C:/StockData/Cisco.xls"
You would then run the program from a DOS prompt (Start->Programs->Command Prompt) like this:
cscript excel.vbs

Here is the script:

Option Explicit
REM We use "Option Explicit" to help us check for coding mistakes

REM the Excel Application
Dim objExcel
REM the path to the excel file
Dim excelPath
REM how many worksheets are in the current excel file
Dim worksheetCount
Dim counter
REM the worksheet we are currently getting data from
Dim currentWorkSheet
REM the number of columns in the current worksheet that have data in them
Dim usedColumnsCount
REM the number of rows in the current worksheet that have data in them
Dim usedRowsCount
Dim row
Dim column
REM the topmost row in the current worksheet that has data in it
Dim top
REM the leftmost row in the current worksheet that has data in it
Dim left
Dim Cells
REM the current row and column of the current worksheet we are reading
Dim curCol
Dim curRow
REM the value of the current row and column of the current worksheet we are reading
Dim word

WScript.Echo "Reading Data from " & excelPath

REM where is the Excel file located?
excelPath = "C:/ExcelFiles/Book2.xls"

REM Create an invisible version of Excel
Set objExcel = CreateObject("Excel.Application")

REM don't display any messages about documents needing to be converted
REM from old Excel file formats
objExcel.DisplayAlerts = 0

REM open the excel document as read-only
REM open (path, confirmconversions, readonly)
objExcel.Workbooks.open excelPath, false, true


REM How many worksheets are in this Excel documents
workSheetCount = objExcel.Worksheets.Count

WScript.Echo "We have " & workSheetCount & " worksheets"

REM Loop through each worksheet
For counter = 1 to workSheetCount
WScript.Echo "-----------------------------------------------"
WScript.Echo "Reading data from worksheet " & counter & vbCRLF

Set currentWorkSheet = objExcel.ActiveWorkbook.Worksheets(counter)
REM how many columns are used in the current worksheet
usedColumnsCount = currentWorkSheet.UsedRange.Columns.Count
REM how many rows are used in the current worksheet
usedRowsCount = currentWorkSheet.UsedRange.Rows.Count

REM What is the topmost row in the spreadsheet that has data in it
top = currentWorksheet.UsedRange.Row
REM What is the leftmost column in the spreadsheet that has data in it
left = currentWorksheet.UsedRange.Column


Set Cells = currentWorksheet.Cells
REM Loop through each row in the worksheet
For row = 0 to (usedRowsCount-1)

REM Loop through each column in the worksheet
For column = 0 to usedColumnsCount-1
REM only look at rows that are in the "used" range
curRow = row+top
REM only look at columns that are in the "used" range
curCol = column+left
REM get the value/word that is in the cell
word = Cells(curRow,curCol).Value
REM display the column on the screen
WScript.Echo (word)
Next
Next

REM We are done with the current worksheet, release the memory
Set currentWorkSheet = Nothing
Next

objExcel.Workbooks(1).Close
objExcel.Quit

Set currentWorkSheet = Nothing
REM We are done with the Excel object, release it from memory
Set objExcel = Nothing

libXL 3.6.4.0 For Windows 最新完美破解 libXL 3.6.4.0 For Windows 最新完美破解,用libxl-3.6.4.0\Crack\libxl.dll即可无限制地使用本程序库了。 libXL 能直接读写Excel文件而不依赖于是否安装Microsoft Office。 立即下载

相关推荐

读取excel库libxl-3.8.0.0(.xlsx,xls,32位和64位都可使用,真的可以用)

读取excel库libxl-3.8.0.0(.xlsx,xls,32位和64位都可使用,真的可以用)

wincc报表日报表实例_WINCC一起学-VBS读取变量归档--五 日报表示例

10.1 简介本来应该早就把这个写出来,可是报表的界面不知道如何设计,前两天帮人做了一个报表,正好有日报表和月报表,这次把日报表写一下,然后再说一下月报表,算是结束,总算没有烂尾。这个报表的界面如下图:10.2 思路介绍根据表格格式,由于全部的变量没有统一的规律,根据有规律的变量,报表分三次查询,第一次查询为压差和瞬时产水量(红色框),然后查询来水的几个参数(黄色框),最后计算日产水量。查询完成后...

weixin_42360788的博客 7343

libXL 3.8.0 For Windows 正式授权及使用方法

libXL 3.8.0 For Windows最新版,包含正式授权License及使用方法,所有c++例程已测试可用。

vbs冒泡效果

这个功能的原理呢,就是用vbs生成exe文件,然后运行,只不过这个exe比较小,不用两个文件了,一个vbs即可实现vbs冒泡效果 Data="4D5A00000000000000000000504500004C010200534C58210000000000000000E0000F010B01000000000000000600000000000054010000001000000C000000...

szjy8的专栏 641

[内含注册机]LibXL.for.Windows.3.7.2.Incl.Keygen

LibXL is a library that can read and write Excel files. It doesn't require Microsoft Excel and .NET framework, combines an easy to use and powerful features. Library can be used to Generate a new spreadsheet from scratch Extract data from an existing spreadsheet Edit an existing spreadsheet LibXL can help your applications in exporting and extracting data to/from Excel files with minimum effort. Also it can be used as report engine. Library can be used in C, C++, C#, Delphi, Fortran and other languages. Supports Excel 97-2003 binary formats (xls) and Excel 2007-2013 xml formats (xlsx/xlsm). Supports Unicode and 64-bit platforms. There are a wrapper for .NET developers and separate Linux, Mac and iOS editions. See features of the library in demo.xls or demo.xlsx files.

04目标检测-Two-stage的目标检测算法

前面我们对进行了对比分析,同时上一篇我们介绍了传统算法在目标检测的原理和效果,此篇我们记录了我学习目标检测算法的深度,深入讲述一下深度学习算法在目标检测的原理和效果。原文链接:https://blog.csdn.net/qq_41946216/article/details/132800752。版权声明:本文为CSDN博主「爱吃面的猫」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。One-stage(YOLO和SSD系列):直接回归目标位置。

qq_41946216的博客 3657

Generate Excel Spreadsheet from PeopleCode

PeopleBooks documents the built-in function GenerateQueryContentURL. It's a helpful function that lets you create a link to a query. If you append the query criteria as URL parameters, you can br

David Tech Lab 833

Word公式一键转MathType保姆级教程(附omml2mml.xsl报错终极解决方案)

本文提供Word公式一键转MathType的保姆级教程,重点解决常见的omml2mml.xsl报错问题。通过详细分析报错原因、官方解决方案实操步骤及转换后格式优化技巧,帮助用户高效完成公式转换,适用于科研论文和商业文档编辑。

weixin_30082367的博客 606

VBS 结合变量做延时脚本处理

第一步:新建变量组并创建两个变量:SleepBool1 表示 启动定时器,SleepTime1表示 计时器; 第二步: 新建一个窗口,并创建一个按钮和一个文本关联动画 第三步: 给按钮添加左键按下事件,脚本如下 MsgBox "开始启动" Var.VarSleep.SleepBool1=True 第四步: 单击窗口空白处,选择事件找到画面程序,点击添加“运行方式”为运行时每隔10...

青苹果工作室 6735

logisim计组实验八 乘法器

原理:点这里 有问题欢迎留言哦~ 文章目录五位阵列乘法器电路图时间延迟分析六位补码阵列乘法器五位无符号乘法流水线原理图电路图原码一位乘法器原理图电路图补码一位乘法器 五位阵列乘法器 电路图 此处注意:全加器FA的cout端是进位端而非输出端 使用硬件控制比循环累加的速度快得多。 但是存在串行进位链 改进版: 时间延迟分析 T是计算相加数的一级门延迟 3n–>2n 性能差别在1.5倍 ...

treblez's blog 2万+

VI恒流源原理详细分析(0~10V转0/4~20mA)

但是此电阻也不能无限增加,首先我们所列方程均是基于运放虚短虚断的假设,此假设又是基于运放输入阻抗无穷大,输出阻抗无穷小的前提条件,然而实际的运放并非理想运放,对于TL082IDR这款运放,其Rid(Common-mode input resistance)典型值为1TΩ,以此来看感觉1MΩ确实还不是很大,但是还有另一个影响因素需要考虑,那就是电路的抗干扰能力,原则上,电阻越大受到外部干扰的可能性越大。也就是实现Uin 0~10V变化时对应Iout 0~20mA的一个线性对应关系。

IOTBOT的博客 2922

VBS生成Excel报告的常用操作

On Error Resume Next Dim FileName, SheetName, Text, ExcelApp, ExcelBook, ExcelSheet FileName = "D:/Book1.xls" SheetName = "新建表" Text = "Hello QTP ! 你好, QuickTestProfessional !" Set ExcelApp = CreateO

ZXL工作室 3152

Appsflyer S2S事件上报实战:从参数获取到避坑指南(附Firebase对比)

本文详细解析了Appsflyer S2S事件上报的实战技巧,包括核心参数获取、测试环境搭建、生产环境最佳实践以及高级场景处理。通过对比Firebase的事件上报机制,帮助开发者高效避坑并优化数据上报流程,提升应用分析与营销效果。

egg99的博客 889

一篇讲autoconf/automake的好文章

http://www.cngnu.org/technology/7c1e/292.html

国产开源 GUI 引擎 AWTK 4015

PLS-PM with R 偏最小二乘路径建模 (R语言)

1. 引入 1.1. 安装plspm包 plspm 是一个用于执行偏最小二乘路径建模分析的 r 程序包。 在 CRAN 上可以免费下载: Http://cran.r-project.org/web/packages/plspm/index.html. 此后,通过以下代码在r中安装并加载该程序包即可。 install.packages("plspm") library("plspm") 2. 一些简单概念 2.1. 潜变量和观测变量 不少变量如满意度、成功指数是无法通过观测得到

Wowlittlemoon的博客 1万+

8、对比 LightGBM、XGBoost 和深度学习

本文对比了LightGBM、XGBoost和深度学习模型(特别是TabTransformer)在处理表格数据时的性能差异。从模型复杂度、数据准备、训练时间、准确性和适用场景等方面进行分析,重点探讨了三者在人口普查收入预测任务中的表现。文章详细介绍了XGBoost与LightGBM的核心特性与区别,深入讲解了TabTransformer的架构与实现,并涵盖了分类特征编码、缺失值处理和类别不平衡等关键数据预处理技术,为选择合适的表格数据建模方法提供了实践指导。

julia4scientist的博客 122

MS-DOS autocomplete in Microsoft Windows 2000 and above

Open the Microsoft Windows registry editor by clicking Start / Run / type Regedit and click ok.In the Microsoft Windows registry editor open the below folders.

国产开源 GUI 引擎 AWTK 2786

嵌入式通信协议框架的四层架构设计与实现

本文详细介绍一种模块化的嵌入式通信协议框架设计,采用四层架构:硬件抽象层统一管理数据收发与缓冲,隔离硬件差异;协议管理层通过特征识别自动路由多协议数据,支持动态扩展;协议处理层独立实现各协议解析/构建,确保校验安全与零拷贝效率;应用层采用表驱动模式处理业务逻辑,与协议细节解耦。 该架构已应用于工业控制等领域,具备强类型安全、高扩展性和平台无关性特点,显著提升复通信场景下的开发效率与系统可靠性。提供完整代码实现与设计要点分析,助力开发者构建高效通信栈。

Bit_Dong的博客 2475

第 05 讲 · JSON 转表格还在写脚本?Excel 里一个函数直接展开 API 数据(Excel JSON 转表格教程)

运营甩来一段接口返回的 JSON,别急着打开 Python 配环境。本文用 http_Get 拉取数据,再用 json_提取值、Json转表格、数组转表格、表格转 JSON、XML 转 JSON 一套组合拳,在单元格里把接口数据直接摊成表格,全程不写脚本。

u013385671的博客 132

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

经销商返利核算:用 Excel 维护规则,还是用指标平台统一计算?

Excel 适合规则简单、经销商数量有限且需要人工复核的返利核算;指标语义平台适合统一销售基数和已确认的计算口径,供多个团队复用。两者可以组合:业务部门确认合同规则,平台辅助计算,财务负责对账、审批和结算。复杂合同条款及规则管理能力应在实施前单独验证。

Aloudata的博客 166

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

上一篇: Microsoft Excel Scripts
下一篇: 香港一日游
李先静
博客等级 码龄24年 2万+粉丝 846原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值