明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1303|回复: 2

[讨论] (vlax-put-property range 'value (vlax-make-variant "字符串2"))为什么错

[复制链接]
发表于 2014-5-13 22:50 | 显示全部楼层 |阅读模式
(defun c:test (/ Excel wbooks wbook sheet cells range)
        ;(setq Excel (vlax-create-object "excel.application"))
        (setq Excel (vlax-get-or-create-object "excel.application"))
        (vla-put-Visible Excel :vlax-true)
        (setq wbooks (vlax-get-property Excel 'workbooks))
        (setq wbook (vlax-invoke-method wbooks 'add))
        (setq sheets (vlax-get-property wbook 'sheets))
        (setq sheet (vlax-get-property sheets 'item 1))
        (setq cells (vlax-get-property sheet 'cells))
        (setq range (vlax-get-property cells 'range "A1"))
        (vlax-put range 'value "字符串1");此处为什么不能用(vlax-put-property range 'value (vlax-make-variant "字符串2"))代替
        (alert (vlax-get range 'value));(alert (vlax-variant-value (vlax-get-property range 'value)))
        (princ)
)

(vlax-put-property range 'value (vlax-make-variant "字符串2"))为什么错,而(vlax-put range 'value "字符串1")则正确。



"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2014-5-15 20:57 | 显示全部楼层
高手们关注一下!!
发表于 2014-5-15 21:31 来自手机 | 显示全部楼层
会不会后者是早期的,前者是后期的,AutoCAD开倒车?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-19 21:53 , Processed in 0.182909 second(s), 30 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表