马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun $excel-rang-copy$
- (xlapp SH-N-O SH-N-new address-o
- address-n lst / xlsheet1
- xlsheet2
- )
- ;单元格复制
- ;SH-N-O原sheet表名
- ;SH-N-new 新的目标sheet表名
- ;address-o原复制单元格地址
- ;address-n 新的单元格地址
- (or xlapp (setq xlapp ($xlapp-New$ NIL nil nil)))
- (or SH-N-new (setq SH-N-new SH-N-O))
- (setq xlsheet1
- (vl-catch-all-apply
- 'vlax-get-property
- (list (vl-catch-all-apply
- 'vlax-get-property
- (list (vl-catch-all-apply
- 'vlax-get-property
- (list xlapp 'activeworkbook)
- )
- 'Sheets
- )
- )
- 'Item
- SH-N-O
- )
- )
- )
- (setq xlsheet2
- (vl-catch-all-apply
- 'vlax-get-property
- (list (vl-catch-all-apply
- 'vlax-get-property
- (list (vl-catch-all-apply
- 'vlax-get-property
- (list xlapp 'activeworkbook)
- )
- 'Sheets
- )
- )
- 'Item
- SH-N-new
- )
- )
- )
- (vl-catch-all-apply
- 'vlax-invoke-method
- (list (vl-catch-all-apply
- 'msxlp-get-range
- (list xlsheet1 address-o)
- )
- 'copy
- (vl-catch-all-apply
- 'msxlp-get-range
- (list xlsheet2 address-n)
- )
- )
- )
- )
|