vbs : Format a Range of Cells
来源:互联网 发布:Linux持续ping命令 编辑:程序博客网 时间:2024/06/09 04:43
Excel 国产化为 ET
先测试一下 test.vbs
On Error Resume Next' try to connect to et or excelSet ExcelApp = GetObject(, "Excel.Application")If ExcelApp Is Nothing Then Set ExcelApp = GetObject(, "KET.Application") If ExcelApp Is Nothing Then Set ExcelApp = GetObject(, "ET.Application") If ExcelApp Is Nothing Then MsgBox "Run Excel or Kingsoft ET first.", vbInformation, "Information" WScript.Quit Else WScript.Echo "ET.Application" End If Else WScript.Echo "KET.Application" End IfElseWScript.Echo "Excel.Application"End IfOn Error Goto 0
WPS 2012 用 Set objE = CreateObject("ET.Application")
WPS 2013 用 Set objE = CreateObject("KET.Application")
国产软件真是多变啊!
例子来自 www.vbsedit.com
FormataRange.vbs 代码如下
' Format a Range of CellsSet objE = CreateObject("ET.Application")objE.Visible = TrueobjE.Workbooks.AddobjE.Cells(1, 1).Value = "Name"objE.Cells(1, 1).Font.Bold = TRUEobjE.Cells(1, 1).Interior.ColorIndex = 30objE.Cells(1, 1).Font.ColorIndex = 2objE.Cells(2, 1).Value = "1.0"objE.Cells(3, 1).Value = "0.2"objE.Cells(4, 1).Value = "0.03"objE.Cells(5, 1).Value = "0.004"Set objRange = objE.Range("A1","A5")objRange.Font.Size = 14Set objRange = objE.Range("A2","A5")objRange.Interior.ColorIndex = 36objRange.Style = "Percent"Set objRange = objE.ActiveCell.EntireColumnobjRange.AutoFit()
objE.ActiveWorkbook.SaveAs("D:\test1.xls")
0 0
- vbs : Format a Range of Cells
- Set the number format of cells in an Excel file
- rowid format and the format of a row piece
- general format of a zip file
- XCEL之Range,cells,offset,end用法
- EXCEL之Range,cells,offset,end用法
- Excel中range和cells的详解
- Android Conversion to Dalvik format failed: Unable to execute dex: Target out of range: +0000fffa
- Commenting out a range of lines in VIM
- CareerCup Randomly return a number inside of this range
- Print nodes in a given range of BST
- GWT-Defining a module: format of module XML files
- UTF-8, a transformation format of Unicode and ISO 10646
- What is the format of a git “blob”?
- Output format of a 10046 sql trace file
- Reduce a date range to an array of the last days of each month?
- 4 the cells of the nervous system
- VBS基础篇 - 内置函数 - Format 函数
- R中的grep、grepl、sub、gsub、regexpr、gregexpr等函数
- Java 与C++的某些不同之处
- oracle手工生成AWR报告方法
- 序章 1998年5月2日 HIDE 亡故
- 自传 第一章 永别 告别式 (一)
- vbs : Format a Range of Cells
- UISegmentedControl UISlider
- 自传 第一章 永别 告别式 (二)
- 易宝抢滩第二波:发力中后台流程改造
- 苹果Mac10.9下Qt 5.3.2的安装、配置(1)
- 内存区划分、内存分配、常量存储区、堆、栈、自由存储区、全局区[C++][内存管理]
- 【网络流】 HDU4240 Route Redundancy 基础
- equals ==
- 【iOS开发-27】解决方案:An error was encountered while running(Domain=FBSOpenApplicationErrorDomain, Code=4)