I know that you can open an Excel file from the win cmd line. But how would you open a particular spreadsheet in that file using win cmd?

解决方案Paste the following code into a text editor (NotePad, WordPad, Word

etc)

Save the file with a "vbs" extension, for example

ExcelSheet2.vbs

Change this line strFileName = "c:\temp\testa.xlsx" to your

desired Excel file path

You can then run this from the commandline by entering the path name of your vbs file

The code has error handling in case the filepath is wrong, or a second sheet isn't present.

[Updated: added further error handling to test for the second sheet being hidden]

Const xlVisible = -1

Dim objExcel

Dim objWb

Dim objws

Dim strFileName

strFileName = "c:\temp\test.xlsx"

On Error Resume Next

Set objExcel = CreateObject("excel.application")

Set objWb = objExcel.Workbooks.Open(strFileName)

Set objws = objWb.Sheets(2)

On Error GoTo 0

If Not IsEmpty(objws) Then

If objws.Visible = xlVisible Then

objExcel.Goto objws.Range("a1")

Else

wscript.echo "the 2nd sheet is present but is hidden"

End If

objExcel.Visible = True

Else

objExcel.Quit

Set objExcel = Nothing

If IsEmpty(objWb) Then

wscript.echo strFileName & " not found"

Else

wscript.echo "sheet2 not found"

End If

End If

cmd看excel有多少个子表_什么win cmd打开特定的电子表格在Excel?相关推荐

  1. cmd看excel有多少个子表_快看!杭州各区5月房价表出炉!现在买套房要多少钱?...

    以下二手房价信息综合整理于房天下.安居客 数据仅供参考 杭州房价走势 杭州5月二手房均价 27855 元/m² 杭州4月二手房均价 27600 元/m² 环比上月上涨 0.92% ↑ 同比去年同期下跌 ...

  2. cmd看excel有多少个子表_excel表格拆分成多个表格方法工具

    在日常的工作中,我们可能会遇到将一个工作簿中包含的多个工作表单独拆分成一个个独立的excel,以便将各个独立的工作表分发给需要的人看.这里介绍怎么样将excel工作簿(含多个工作表)拆分成多个独立的工 ...

  3. excel数据透视表_无痛的方式隐藏Excel数据透视表项

    excel数据透视表 If you're working with an Excel 2007 pivot table, you might want to temporarily hide one ...

  4. excel数据透视表_来自多个工作表的Excel数据透视表更新

    excel数据透视表 If you have similar data on two or more worksheets, you might want to combine that data i ...

  5. aspose excel中文文档_除了VBA,还有哪些编程语言可以操作Excel文件?

    Excel(Microsoft office)是现在最常用的办公软件,主要涉及电子表格制作.数据处理.报表输出展示以及更高端的还有金融建模等:我们知道,在需要批处理多个Excel工作表以及工作簿的时候 ...

  6. python打开excel表_如何用python打开excel

    最近看到好几次群里有人问xlwt.wlrd的问题,怎么说呢,如果是office2007刚出来,大家用xlsx文件用不习惯,还可以理解,这都10年过去了喂,就算没有进化到office2016,还在用of ...

  7. python实现excel数据透视表_用python建立excel的数据透视表

    import pandas as pd import numpy as np #1.建立一维数据 a = pd.Series(['a','b','c','d','e']) print(a) #2.建立 ...

  8. excel帮助文档_可以惊艳到你的6个excel基础技巧

    Excel技巧太多,也许我们一直都在学习的路上,每天掌握一点点,工作轻松一点点,今天给大家带来6个excel经常会用到的技巧,操作简单,非常实用. 技巧一:给excel文件添加打开密码第一步,很多小伙 ...

  9. python向excel隔行写数据_【Python】将每日新增数据写入Excel

    一.背景: 因为自己从网上获取了一些金融数据,也没有配置数据库,所以目前暂时是将数据以增量的形式存储在自己的OneDrive上. 二.代码演绎:导入相关数据包 import pandas as pd ...

  10. excel自动调整列宽_办公软件操作技巧012:如何调整excel表格的行高与列宽

    在日常工作中,我们经常会使用excel编辑电子表格,但有时默认的行高与列宽与单元格内数据内容的高度和长度会不太匹配,如下图,这时就需要调整表格的行高和列宽,那么今天就来和大家分享几种调整excel表格 ...

最新文章

  1. c++ 创建 mat
  2. Android N Display Size
  3. 关于ByteBuffer使用解释
  4. 数字示波器的激烈竞争
  5. 浅谈Time Elastic Band
  6. ASP.NET 安全认证
  7. 红帽干掉 CentOS 8,CentOS Stream 上位
  8. 本示例主要展示如何在XtraGrid网格控件(包含在DevExpress WinForms套包中)的主视图中指定HyperLinkEdit控件作为列编辑器...
  9. 关于VMware的Server版卸载须知
  10. android iphone字体,网站中的字体设置--兼容苹果、pc、安卓系统的字体设置
  11. excel图表模板免费下载_40个免费的信息图表模板下载
  12. 【转载】android开发笔记之fastboot的使用
  13. 学 stm 32 单片机
  14. 如何选择DDoS防御服务器
  15. 【知识点和练习题】心田花开:二年级语文汉语拼音补习
  16. Cardano(ADA), EOS, RChain(RHOC), Aeternity(AE) 都是极其好的币
  17. GaussianNetwork高斯网络
  18. EditTextand TextView
  19. 如何拦截烦人的视频广告
  20. 如何让Markdown 表格整体居中?

热门文章

  1. setup_per_cpu_areas 函数
  2. 二分(POJ - 3273 )
  3. flutter 全选_Android Studio写flutter快捷键
  4. 链表常见操作java实现一:链表初始化,求链表长度
  5. java 常用习惯用法总结
  6. html中不支持什么元素,html5新元素和html不支持的元素
  7. mysql关于用户的知识_关于mysql的基础知识
  8. 亮度翻转_双轴翻转屏设计 ConceptD 3 Ezel设计师本评测
  9. html src data:image,Browser/HTML Force download of image from src=“data:image/jpeg;base64…”
  10. delphi启动ie调用本地html传参数_年轻人不讲武德啊!了解下浏览器如何解析html、css,js