标题: [其他] 批处理能创建xls文件的批注吗? [打印本页]
作者: FOR 时间: 2014-5-8 16:50 标题: 批处理能创建xls文件的批注吗?
批处理能创建xls文件的批注吗?
如图
我想鼠标移到200上面的时候就显示“每箱20包”
请问这个xls文件怎么用批处理来完成?
作者: apang 时间: 2014-5-8 19:36
批处理估计不行,vbs可以这样:- Set oExcel = CreateObject("Excel.Application")
- oExcel.Visible = true
- Set oBook = oExcel.WorkBooks.Add
- Set oSheet = oBook.WorkSheets.Add
-
- oExcel.Cells(1, 1) = "型号"
- oExcel.Cells(1, 2) = "数量"
- oExcel.Cells(2, 1) = "统一方便面"
- oExcel.Cells(2, 2) = "200"
- oExcel.Cells(2, 2).AddComment "每箱20包"
复制代码
作者: FOR 时间: 2014-5-13 11:33
回复 2# apang
谢谢,收藏先
作者: CrLf 时间: 2014-5-13 17:50
纯批方案示例:- @echo off&rem
- (
- echo ^<html xmlns:v="urn:schemas-microsoft-com:vml"
- echo xmlns:o="urn:schemas-microsoft-com:office:office"
- echo xmlns:x="urn:schemas-microsoft-com:office:excel"^>
- rem 必须
-
- echo ^<table^>
- echo ^<th^>^<td^>^<b^>1^</b^>^</td^>^<td^>^<b^>2^</b^>^</td^>^</th^>
- echo ^<tr^>^<td^>^<i^>测试^</i^>^</td^>^<td^>批注A^</td^>^<td^>批注B^</td^>^</tr^>
- echo ^</table^>
- rem 正常表格
-
- echo ^<div style='mso-element:comment-list'^>
- call :批注 1 1 标题1 内容1
- rem 批注1
-
- call :批注 1 2 标题2 内容2
- rem 批注2
- echo ^</div^>
-
- )>test.xls
-
- start test.xls
- pause & exit /b
-
- :批注
- set /a 批注+=1
- (
- echo ^<div style='mso-element:comment'^>
- echo ^<div^>^<xml^>
- echo ^<v:shapetype id="_t%批注%"
- echo path="m,l,21600r21600,l21600,xe"^>
- echo ^<v:stroke joinstyle="miter"/^>
- echo ^<v:path gradientshapeok="t" o:connecttype="rect"/^>
- echo ^</v:shapetype^>^<v:shape id="_s%批注%" type="#_t%批注%" style='position:absolute;
- echo margin-left:173.25pt;margin-top:1.5pt;width:96pt;height:59.25pt;z-index:%批注%;
- echo visibility:hidden' fillcolor="infoBackground [80]" o:insetmode="auto"^>
- echo ^<v:fill color2="infoBackground [80]"/^>
- echo ^<v:shadow on="t" obscured="t"/^>
- echo ^<v:path /^>
- echo ^<v:textbox style='mso-direction-alt:auto'/^>
- echo ^<x:ClientData ObjectType="Note"^>
- echo ^<x:MoveWithCells/^>
- echo ^<x:SizeWithCells/^>
- echo ^<x:AutoFill^>False^</x:AutoFill^>
- echo ^<x:Row^>%1^</x:Row^>
- echo ^<x:Column^>%2^</x:Column^>
- echo ^</x:ClientData^>
- echo ^</v:shape^>^</xml^>^<span style='mso-ignore:vglayout'^>
- echo ^<div v:shape="_s%批注%"^>
- echo ^<font style="font-size:9.0pt;font-family:宋体;font-weight:700"^>
- echo;%3
- echo ^</font^>^<br^>
- echo;%4
- echo ^</div^>^</span^>
- echo ^</div^>
- )
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |