(setq excel (vlax-create-object "Excel.Application") ;; open Excel
activesheet (vlax-get-property excel 'ActiveSheet) ;; get the active sheet
cells (vlax-get-property activesheet 'Cells) ;; get cells from a sheet
)
对不起,我忘了说了哈哈
但是如果不使用“value”函数,如何从单元格中获取文本? 主题#1,红线中的变量val。
如果这两行从#9合并成一行,你会得到与我相同的结果:
15
行和列不一定是变体,它们可以是整数。
是的,你说得对。我刚刚又看到了你的第一篇帖子哈哈 (vlax put property cel“评论” Alquien sabe como agregar comentarios en una celda de excel?
(vlax put property cel“AddComment”…)
没有logro me功能 这是一个新创建的Excel文件的快速演示,
从那里抓取代码块添加注释
(defun C:ADC(/*error*comments fname xlapp xlbook xlbooks xlcells xlrange xlsheet xlsheets)(defun*error*(msg)(if(vl positionmsg’(“控制台中断”“函数取消”“退出/退出中止”))(princ“error!”)(princ msg))(princ))(if(setq comments“将您的注释放在这一行或下一行”)(progn(alert“Wait…”)(setq xlapp(vlax get or create object“Excel.Application”)xlbook(vlax get property xlapp”工作簿)xlbook(vlax invoke method xlbook’Add)xlsheets(vlax get property xlbook’Sheets)xlsheet(vlax get property xlsheets’Item 1)xlcells(vlax get property xlsheet’Cells))(vla put visible xlapp:vlax true)(setq xlrange(vl-catch-all-apply'vlax-get-property(list xlsheet’range(vlax make variant“B2”8 1072;а)-(vl-catch-all-apply'vlax-invoke-method(list xlrange'select))(setq xlcomment(vl-catch-all-apply'vlax-invoke-method(list xlrange'addcomment(vlax make variant comments)))(vl-catch-all-apply'vlax-put-property(list xlcomment'visible:vlax true))(setq fname(strcat(getvar“dwgprefix”)(vl string right trim.dwg)(getvar“dwgname”))“_Comments.xls”); 性能网络。。。。谢谢ufff 很高兴我能帮忙
干杯 ?你知道用这个方法或属性,正如现在可能读到的单元格注释一样。谢谢 试试这个
(定义C:RCOM(/desc x xlapp xlbook xlbooks xlcomment xlrange xlshape xlsheet xlsheets)(vl load com);制作适当的excel对象(setq xlapp(vlax get或create object“excel.Application”)xlbook(vlax get xlapp”工作簿)xlbook(vlax invoke method xlbooks“Open”C:\\YourFilenamePath.xls”);
页:
1
[2]