Leaderboard
Popular Content
Showing content with the highest reputation on 10/12/2025 in all areas
-
Hey glad to see some one else that plays god and walks on water look at my image.1 point
-
(vlax-put-property cells0 'item y x "textstring") I think, this works with text string or text string variable only. Because Excel treats images as special objects separate from cell values so, the lisp code you get in internet. also shifting down images and shifting right images in units of pixels, not cells. of course, there is a way to create a function using Excel's vba macro and insert an image into a cell, but I don't think it's a good way to put a macro in every target Excel file and change it to an .xlsm file for all work. or if you want use that sentence, can approach like this way making image to not replace. (with loop and indexing name of image) ='<img src=""full path of image" "width=100 height=100 ><table> and copy to clipboard and paste special to put unicode format texts. i success to put them all. but I failed to load image. it's not good way also. because images is not in excel. so, I thnk below is better and different way to approach make loop like this (defun c:ssw2 (/ index r c) (setq index 0) (setq r 1) (setq c 1) (while (c:ssw) (setq r (+ r 1)) (setq index (+ index 1)) ) ) and add this (setq addr (strcat (chr (+ 64 c)) (itoa r) ":" (chr (+ (ascii (chr (+ 64 c))) (1- 1))) (itoa (+ r (1- 1))))) (setq rng (vlax-get-property activesheet0 'Range addr)) (vlax-invoke Rng 'Select) in front of this (setq pic (vlax-get activesheet0 'Pictures)) ;Pictures object (setq picture (vlax-invoke pic 'insert ph)) ;execute insert image because this routine is paste in current selected cell in excel. so, this additional code will change selected cell. but this is start from column 1, row 1 it will be change with this, paste it in front of ssw2 (setq ExcelApp (vl-catch-all-apply (function (lambda ()(vlax-get-or-create-object "Excel.Application"))))) (if (vl-catch-all-error-p (setq Wbk (vl-catch-all-apply (function (lambda () (vlax-get-property ExcelApp "ActiveWorkBook")))))) (progn (alert "open Excel before you run this") (exit) (*error* nil) (princ) ) ) (setq Sht (vl-catch-all-apply (function (lambda () (vlax-get-property ExcelApp "ActiveSheet"))))) (vlax-put-property ExcelApp 'visible :vlax-true) (vlax-put-property ExcelApp 'ScreenUpdating :vlax-true) (vlax-put-property ExcelApp 'DisplayAlerts :vlax-false) (princ "\n go to excel then select cell to paste picture") (if (not (vl-catch-all-error-p (setq Rng (vl-catch-all-apply (function (lambda () (vlax-variant-value (vlax-invoke-method (vlax-get-property Wbk 'Application) 'Inputbox "select 1 cell you put in : " "ssw" nil nil nil nil nil 8)))))))) (progn (vlax-put-property ExcelApp 'DisplayAlerts :vlax-true) (setq r (vlax-get-property Rng 'row)) (setq c (vlax-get-property Rng 'column)) ExcelApp and Wbk is same with in ssw's. you can optimize this. and then select entire row. and change row height ============= like this ; instant screenshot for excel - 2022.03.07 exceed ; open target excel sheet before run this lisp. ; ; - command ; ssw - screenshot .wmf to selected cell in excel ; ssp - screenshot .png to selected cell in excel ; ssw2 - screenshot .wmf to excel continuously from selected cell ; ssp2 - screenshot .png to excel continuously from selected cell ; ; note - If the height is much longer than the width, a wider range than the set width can be seen. ; Due to a limitation in Excel, the maximum cell height is 409.5. (vl-load-com) (defun c:ssw (/ *error* ods acdoc pt1 pt2 ph x_dist_selection y_dist_selection xy_ratio input_width input_height ss app activeworkbook0 activesheet0 cells0 shape pic picture width_you_want) (setvar "cmdecho" 0) (setq ods (getvar "osmode")) (setvar "osmode" 0) (LM:startundo (LM:acdoc)) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) (princ "\nPlease open the excel sheet before running.\nInserts the selected area screenshot into the selected cell in Excel as a wmf image. (background transparent)") (ex:ESMAKE) (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (setq pt1 (getpoint "\nSelect the first point:") pt2 (getcorner pt1 "\nselect the second point:") ph (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) "-" (rtos (getvar 'cdate) 2 10) ".wmf") ;edited line ) (setq x_dist_selection (abs (- (car pt1) (car pt2)) )) ;edited line (setq y_dist_selection (abs (- (cadr pt1) (cadr pt2)) )) ;edited line (setq xy_ratio (/ y_dist_selection x_dist_selection)) ;edited line (setq input_width 1000) ;input fixed value for simplify (setq input_height (atoi (rtos (* input_width xy_ratio) 2 0)) ) (setq input_width (+ input_width 16)) ; 16 is my environment gap of window size & image size. shoud be edited (setq input_height (+ input_height 55)) ; 55 is my environment gap of window size & image size. shoud be edited (if (= (findfile ph) nil) (progn (princ "\nCreate new image file ") ) (progn (vl-file-delete ph) (princ "\nReplace image file") ) ) (if (setq ss (ssget "c" pt1 pt2)) ;'((0 . "lwpolyline,line,ARC")))) (progn (command "_Zoom" "w" pt1 pt2 "") (vla-put-height acdoc input_height) ;edited line (vla-put-width acdoc input_width) ;edited line (command "_wmfout" ph "all" "") ;edited line for all entities, replace with (command "_wmfout" ph ss "") ) ) (command "_Zoom" "p") (vla-put-windowstate acdoc 3) ;edited line (command "_syswindows" "c") ;edited line (setvar "osmode" ods) (princ "\ndone.") (princ (strcat "\nimage output path:" ph)) (setq app (vlax-get-or-create-object "Excel.Application")) (vla-put-visible app :vlax-true) (vlax-put-property app 'ScreenUpdating :vlax-true) (setq activeworkbook0 (vlax-get-property app 'ActiveWorkbook) ) (setq activesheet0 (vlax-get-property activeworkbook0 'ActiveSheet) ) (setq cells0 (vlax-get-property activesheet0 'cells)) (setq pic (vlax-get activesheet0 'Pictures)) ;Pictures object (setq picture (vlax-invoke pic 'insert ph)) ;execute insert image (vlax-invoke picture 'select) ;select this image (setq shape (vlax-get (vlax-get-property app 'selection) 'shapeRange) ) ;picture object ;(vlax-put shape 'LockAspectRatio 0) ;Release aspect lock ;(vlax-put shape 'Height (/ input_height 3)) ;Set the height of the image (pixels) (setq width_you_want 30) ;edit this 30 value. this is same with width property in excel. (vlax-put shape 'width (* 28.3464566929 width_you_want)) ;Set the width of the image (pixels) ;(vlax-invoke shape 'IncrementTop input_height) ;Set the image downshift distance (pixels) ;(vlax-invoke shape 'IncrementLeft input_width) ;Set the image right shift distance (pixels) ; closing.. ;(vlax-invoke-method app 'Saveas (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) ".xlsx")) ;(vlax-invoke-method app 'Close) ;(vlax-invoke-method app 'Quit) (LM:endundo (LM:acdoc)) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) (defun c:ssp (/ *error* ods acdoc pt1 pt2 ph x_dist_selection y_dist_selection xy_ratio input_width input_height ss app activeworkbook0 activesheet0 cells0 shape pic picture width_you_want ) (setvar "cmdecho" 0) (setq ods (getvar "osmode")) (setvar "osmode" 0) (LM:startundo (LM:acdoc)) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) (princ "\nPlease open the excel sheet before running.\nInserts the selected area screenshot into the selected cell in Excel as a png image.") (ex:ESMAKE) (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (setq pt1 (getpoint "\nSelect the first point:") pt2 (getcorner pt1 "\nselect the second point:") ph (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) "-" (rtos (getvar 'cdate) 2 10) ".png") ;edited line ) (setq x_dist_selection (abs (- (car pt1) (car pt2)) )) ;edited line (setq y_dist_selection (abs (- (cadr pt1) (cadr pt2)) )) ;edited line (setq xy_ratio (/ y_dist_selection x_dist_selection)) ;edited line (setq input_width 1200) ;input fixed value for simplify (setq input_height (atoi (rtos (* input_width xy_ratio) 2 0)) ) (setq input_width (+ input_width 16)) ; 16 is my environment gap of window size & image size. shoud be edited (setq input_height (+ input_height 55)) ; 45 is my environment gap of window size & image size. shoud be edited (if (= (findfile ph) nil) (progn (princ "\nCreate new image file ") ) (progn (vl-file-delete ph) (princ "\nReplace image file") ) ) (if (setq ss (ssget "c" pt1 pt2)) ;'((0 . "lwpolyline,line,ARC")))) (progn (command "_Zoom" "w" pt1 pt2 "") (vla-put-height acdoc input_height) ;edited line (vla-put-width acdoc input_width) ;edited line (command "_pngout" ph "all" "") ;edited line for all entities, replace with (command "_pngout" ph ss "") ) ) (command "_Zoom" "p") (vla-put-windowstate acdoc 3) ;edited line (command "_syswindows" "c") ;edited line (setvar "osmode" ods) (princ "\ndone.") (princ (strcat "\nimage output path:" ph)) (setq app (vlax-get-or-create-object "Excel.Application")) (vla-put-visible app :vlax-true) (vlax-put-property app 'ScreenUpdating :vlax-true) (setq activeworkbook0 (vlax-get-property app 'ActiveWorkbook) ) (setq activesheet0 (vlax-get-property activeworkbook0 'ActiveSheet) ) (setq cells0 (vlax-get-property activesheet0 'cells)) (setq pic (vlax-get activesheet0 'Pictures)) ;Pictures object (setq picture (vlax-invoke pic 'insert ph)) ;execute insert image (vlax-invoke picture 'select) ;select this image (setq shape (vlax-get (vlax-get-property app 'selection) 'shapeRange) ) ;picture object ;(vlax-put shape 'LockAspectRatio 0) ;Release aspect lock ;(vlax-put shape 'Height (/ input_height 3)) ;Set the height of the image (pixels) (setq width_you_want 30) ;edit this 30 value. this is same with width property in excel. (vlax-put shape 'width (* 28.3464566929 width_you_want)) ;Set the width of the image (pixels) ;(vlax-invoke shape 'IncrementTop input_height) ;Set the image downshift distance (pixels) ;(vlax-invoke shape 'IncrementLeft input_width) ;Set the image right shift distance (pixels) ; closing.. ;(vlax-invoke-method app 'Saveas (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) ".xlsx")) ;(vlax-invoke-method app 'Close) ;(vlax-invoke-method app 'Quit) (LM:endundo (LM:acdoc)) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) (defun c:ssw2 (/ *error* addr selectedcolumns columnwidthtofit xlrows xlcolumns rowheighttofit selectedrows app index r c rng activeworkbook0 activesheet0 ods acdoc pt1 pt2 ph x_dist_selection y_dist_selection xy_ratio input_width input_height ss cells0 shape pic picture width_you_want) (setvar "cmdecho" 0) (setq ods (getvar "osmode")) (setvar "osmode" 0) (LM:startundo (LM:acdoc)) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) (princ "\n Screenshot Loop") (ex:ESMAKE) (setq app (vlax-get-or-create-object "Excel.Application")) (if (vl-catch-all-error-p (setq activeworkbook0 (vl-catch-all-apply (function (lambda () (vlax-get-property app "ActiveWorkBook")))))) (progn (alert "open Excel before you run this") (exit) (*error* nil) (princ) ); end of progn ); end of if (setq activesheet0 (vl-catch-all-apply (function (lambda () (vlax-get-property app "ActiveSheet"))))) (setq xlrows (vlax-get-property activesheet0 'Rows)) (setq xlcolumns (vlax-get-property activesheet0 'Columns)) (vlax-put-property app 'visible :vlax-true) (vlax-put-property app 'ScreenUpdating :vlax-true) (vlax-put-property app 'DisplayAlerts :vlax-false) (princ "\n go to excel then select cell to paste picture") (if (not (vl-catch-all-error-p (setq rng (vl-catch-all-apply (function (lambda () (vlax-variant-value (vlax-invoke-method (vlax-get-property activeworkbook0 'Application) 'Inputbox "select 1 cell you put in : " "ssw" nil nil nil nil nil 8)))))))) (progn (vlax-put-property app 'DisplayAlerts :vlax-true) (setq r (vlax-get-property rng 'row)) (setq c (vlax-get-property rng 'column)) ); end of progn );end of if (setq index 0) (while (princ "\nPlease open the excel sheet before running.\nInserts the selected area screenshot into the selected cell in Excel as a wmf image. (background transparent)") (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (setq pt1 (getpoint "\nSelect the first point:") pt2 (getcorner pt1 "\nselect the second point:") ph (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) "-" (rtos (getvar 'cdate) 2 10) ".wmf") ;edited line ) (setq x_dist_selection 0) (setq y_dist_selection 0) (setq xy_ratio 0) (setq x_dist_selection (abs (- (car pt1) (car pt2)) )) ;edited line (setq y_dist_selection (abs (- (cadr pt1) (cadr pt2)) )) ;edited line (setq xy_ratio (/ y_dist_selection x_dist_selection)) ;edited line (setq input_width 1000) ;input fixed value for simplify (setq input_height (atoi (rtos (* input_width xy_ratio) 2 0)) ) (setq input_width (+ input_width 16)) ; 16 is my environment gap of window size & image size. shoud be edited (setq input_height (+ input_height 55)) ; 55 is my environment gap of window size & image size. shoud be edited (if (= (findfile ph) nil) (progn (princ "\nCreate new image file ") ) (progn (vl-file-delete ph) (princ "\nReplace image file") ) ) (if (setq ss (ssget "c" pt1 pt2)) ;'((0 . "lwpolyline,line,ARC")))) (progn (command "_Zoom" "w" pt1 pt2 "") (vla-put-height acdoc input_height) ;edited line (vla-put-width acdoc input_width) ;edited line (command "_wmfout" ph "all" "") ;edited line for all entities, replace with (command "_wmfout" ph ss "") ) ) (command "_Zoom" "p") (vla-put-windowstate acdoc 3) ;edited line (command "_syswindows" "_hor") ;edited line (setvar "osmode" ods) (princ "\ndone.") (princ (strcat "\nimage output path:" ph)) (setq app (vlax-get-or-create-object "Excel.Application")) (vla-put-visible app :vlax-true) (vlax-put-property app 'ScreenUpdating :vlax-true) (setq activeworkbook0 (vlax-get-property app 'ActiveWorkbook) ) (setq activesheet0 (vlax-get-property activeworkbook0 'ActiveSheet) ) (setq cells0 (vlax-get-property activesheet0 'cells)) (setq addr (strcat (chr (+ 64 c)) (itoa r) ":" (chr (+ (ascii (chr (+ 64 c))) (1- 1))) (itoa (+ r (1- 1))))) (setq rng (vlax-get-property activesheet0 'Range addr)) (vlax-invoke Rng 'Select) (setq pic (vlax-get activesheet0 'Pictures)) ;Pictures object (setq picture (vlax-invoke pic 'insert ph)) ;execute insert image (vlax-invoke picture 'select) ;select this image (setq shape (vlax-get (vlax-get-property app 'selection) 'shapeRange) ) ;picture object ;(vlax-put shape 'LockAspectRatio 0) ;Release aspect lock ;(vlax-put shape 'Height (/ input_height 3)) ;Set the height of the image (pixels) (setq width_you_want 10) ;edit this 30 value. this is same with width property in excel. (vlax-put shape 'width (* 28.3464566929 width_you_want)) ;Set the width of the image (pixels) (setq rowheighttofit (* (* width_you_want xy_ratio) 28.3464566929));8.5125)) (setq columnwidthtofit (* width_you_want 4.71267)); (rtos (* 28.3464566929 width_you_want) 2 0)) (if (> rowheighttofit 409) (setq rowheighttofit 409)) (setq selectedrows (vlax-variant-value (vlax-get-property xlrows 'item r))) (vlax-put-property selectedrows 'RowHeight rowheighttofit) (setq selectedcolumns (vlax-variant-value (vlax-get-property xlcolumns 'item c))) (vlax-put-property selectedcolumns 'ColumnWidth columnwidthtofit) ; closing.. ;(vlax-invoke-method app 'Saveas (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) ".xlsx")) ;(vlax-invoke-method app 'Close) ;(vlax-invoke-method app 'Quit) (setq r (+ r 1)) (setq index (+ index 1)) ); end of while (LM:endundo (LM:acdoc)) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) (defun c:ssp2 (/ *error* addr selectedcolumns columnwidthtofit xlrows xlcolumns rowheighttofit selectedrows app index r c rng activeworkbook0 activesheet0 ods acdoc pt1 pt2 ph x_dist_selection y_dist_selection xy_ratio input_width input_height ss cells0 shape pic picture width_you_want) (setvar "cmdecho" 0) (setq ods (getvar "osmode")) (setvar "osmode" 0) (LM:startundo (LM:acdoc)) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) (princ "\n Screenshot Loop") (ex:ESMAKE) (setq app (vlax-get-or-create-object "Excel.Application")) (if (vl-catch-all-error-p (setq activeworkbook0 (vl-catch-all-apply (function (lambda () (vlax-get-property app "ActiveWorkBook")))))) (progn (alert "open Excel before you run this") (exit) (*error* nil) (princ) ); end of progn ); end of if (setq activesheet0 (vl-catch-all-apply (function (lambda () (vlax-get-property app "ActiveSheet"))))) (setq xlrows (vlax-get-property activesheet0 'Rows)) (setq xlcolumns (vlax-get-property activesheet0 'Columns)) (vlax-put-property app 'visible :vlax-true) (vlax-put-property app 'ScreenUpdating :vlax-true) (vlax-put-property app 'DisplayAlerts :vlax-false) (princ "\n go to excel then select cell to paste picture") (if (not (vl-catch-all-error-p (setq rng (vl-catch-all-apply (function (lambda () (vlax-variant-value (vlax-invoke-method (vlax-get-property activeworkbook0 'Application) 'Inputbox "select 1 cell you put in : " "ssw" nil nil nil nil nil 8)))))))) (progn (vlax-put-property app 'DisplayAlerts :vlax-true) (setq r (vlax-get-property rng 'row)) (setq c (vlax-get-property rng 'column)) ); end of progn );end of if (setq index 0) (while (princ "\nPlease open the excel sheet before running.\nInserts the selected area screenshot into the selected cell in Excel as a png image. (background transparent)") (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (setq pt1 (getpoint "\nSelect the first point:") pt2 (getcorner pt1 "\nselect the second point:") ph (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) "-" (rtos (getvar 'cdate) 2 10) ".png") ;edited line ) (setq x_dist_selection 0) (setq y_dist_selection 0) (setq xy_ratio 0) (setq x_dist_selection (abs (- (car pt1) (car pt2)) )) ;edited line (setq y_dist_selection (abs (- (cadr pt1) (cadr pt2)) )) ;edited line (setq xy_ratio (/ y_dist_selection x_dist_selection)) ;edited line (setq input_width 1000) ;input fixed value for simplify (setq input_height (atoi (rtos (* input_width xy_ratio) 2 0)) ) (setq input_width (+ input_width 16)) ; 16 is my environment gap of window size & image size. shoud be edited (setq input_height (+ input_height 55)) ; 55 is my environment gap of window size & image size. shoud be edited (if (= (findfile ph) nil) (progn (princ "\nCreate new image file ") ) (progn (vl-file-delete ph) (princ "\nReplace image file") ) ) (if (setq ss (ssget "c" pt1 pt2)) ;'((0 . "lwpolyline,line,ARC")))) (progn (command "_Zoom" "w" pt1 pt2 "") (vla-put-height acdoc input_height) ;edited line (vla-put-width acdoc input_width) ;edited line (command "_pngout" ph "all" "") ;edited line for all entities, replace with (command "_pngout" ph ss "") ) ) (command "_Zoom" "p") (vla-put-windowstate acdoc 3) ;edited line (command "_syswindows" "_hor") ;edited line (setvar "osmode" ods) (princ "\ndone.") (princ (strcat "\nimage output path:" ph)) (setq app (vlax-get-or-create-object "Excel.Application")) (vla-put-visible app :vlax-true) (vlax-put-property app 'ScreenUpdating :vlax-true) (setq activeworkbook0 (vlax-get-property app 'ActiveWorkbook) ) (setq activesheet0 (vlax-get-property activeworkbook0 'ActiveSheet) ) (setq cells0 (vlax-get-property activesheet0 'cells)) (setq addr (strcat (chr (+ 64 c)) (itoa r) ":" (chr (+ (ascii (chr (+ 64 c))) (1- 1))) (itoa (+ r (1- 1))))) (setq rng (vlax-get-property activesheet0 'Range addr)) (vlax-invoke Rng 'Select) (setq pic (vlax-get activesheet0 'Pictures)) ;Pictures object (setq picture (vlax-invoke pic 'insert ph)) ;execute insert image (vlax-invoke picture 'select) ;select this image (setq shape (vlax-get (vlax-get-property app 'selection) 'shapeRange) ) ;picture object ;(vlax-put shape 'LockAspectRatio 0) ;Release aspect lock ;(vlax-put shape 'Height (/ input_height 3)) ;Set the height of the image (pixels) (setq width_you_want 10) ;edit this 30 value. this is same with width property in excel. (vlax-put shape 'width (* 28.3464566929 width_you_want)) ;Set the width of the image (pixels) (setq rowheighttofit (* (* width_you_want xy_ratio) 28.3464566929));8.5125)) (setq columnwidthtofit (* width_you_want 4.71267)); (rtos (* 28.3464566929 width_you_want) 2 0)) (if (> rowheighttofit 409) (setq rowheighttofit 409)) (setq selectedrows (vlax-variant-value (vlax-get-property xlrows 'item r))) (vlax-put-property selectedrows 'RowHeight rowheighttofit) (setq selectedcolumns (vlax-variant-value (vlax-get-property xlcolumns 'item c))) (vlax-put-property selectedcolumns 'ColumnWidth columnwidthtofit) ; closing.. ;(vlax-invoke-method app 'Saveas (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) ".xlsx")) ;(vlax-invoke-method app 'Close) ;(vlax-invoke-method app 'Quit) (setq r (+ r 1)) (setq index (+ index 1)) ); end of while (LM:endundo (LM:acdoc)) (setvar "cmdecho" 1) (setvar "osmode" ods) (princ) ) ;; Active Document - Lee Mac ;; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) ;; Start Undo - Lee Mac ;; Opens an Undo Group. (defun LM:startundo ( doc ) (LM:endundo doc) (vla-startundomark doc) ) ;; End Undo - Lee Mac ;; Closes an Undo Group. (defun LM:endundo ( doc ) (while (= 8 (logand 8 (getvar 'undoctl))) (vla-endundomark doc) ) ) (defun ex:ESMAKE ( ) ;from BIGAL's ah:chkexcel (setq excelapp (vlax-get-or-create-object "Excel.Application")) (vlax-invoke-method (vlax-get-property excelapp 'Workbooks) 'Add) (vlax-put Excelapp "visible" :vlax-true) (setq Workbooks (vlax-get-property ExcelApp 'Workbooks)) (setq Sheets (vlax-get-property ExcelApp 'Sheets)) (setq AcSheet (vlax-get-property ExcelApp 'ActiveSheet)) (setq accell (vlax-get-property ExcelApp 'Activecell)) (setq xlcols (vlax-get-property acsheet 'Columns)) (setq xlrows (vlax-get-property acsheet 'Rows)) (setq cell (vlax-get-property acsheet 'Cells)) ) (princ "\nSSW, SSP, SSW2, SSP2 - loading complete")1 point
