CadICan Posted May 25, 2020 Posted May 25, 2020 (edited) Hello, I'm very new to this forum. I have looked at several examples, but haven't been able to figure out how to change the text to Bold. I was able to write to the excel spreadsheet. Any help would be much appreciated. Thanks. (VL-LOAD-COM) (defun c:OpenExcelFile () (setvar "cmdecho" 0) ;turn echo off (setvar "tilemode" 0) ;make sure in ps mode (command "._zoom" "e" "") ;zoom extents to ensure item selected (setq ExcelApp (vlax-get-or-create-object "Excel.Application")) (vla-put-visible ExcelApp :vlax-true) (vlax-put-property ExcelApp 'DisplayAlerts :vlax-true) (setq xlbooks (vlax-get-property Excelapp 'Workbooks)) (setq xlbook (vlax-invoke-method xlbooks 'Add)) (setq xlsheets (vlax-get-property xlbook 'Sheets)) (setq xlsheet (vlax-get-property xlsheets 'Item 1)) (setq xlcells (vlax-get-property xlsheet 'Cells)) (setq fname (strcat (getvar "dwgprefix") "DwgTitleBlockInfo" ".xls")) (vlax-invoke-method xlbook 'SaveAs fname nil nil nil :vlax-false :vlax-false 1 2 ) ; (setq Cells (vlax-get-property xlsheet 'Range "A1")) ;****This is where I am having trouble setting the font BOLD ;(setq Font1 (vlax-get-property xlsheet 'Font "A1")) ;(vlax-put-property Font1 "Bold" (vlax-make-variant 1 11)) (vlax-put-property Cells 'Value2 "DRAWING No") (vlax-invoke-method (vlax-get-property xlsheet 'Columns) 'AutoFit) ; (setq Cells (vlax-get-property xlsheet 'Range "B1")) (vlax-put-property Cells 'Value2 "TITLE #1") (vlax-invoke-method (vlax-get-property xlsheet 'Columns) 'AutoFit) ; (setq Cells (vlax-get-property xlsheet 'Range "C1")) (vlax-put-property Cells 'Value2 "TITLE #2") (vlax-invoke-method (vlax-get-property xlsheet 'Columns) 'AutoFit) ; (setq Cells (vlax-get-property xlsheet 'Range "D1")) (vlax-put-property Cells 'Value2 "TITLE #3") (vlax-invoke-method (vlax-get-property xlsheet 'Columns) 'AutoFit) ; ; (setq Cells (vlax-get-property xlsheet 'Range "E1")) (vlax-put-property Cells 'Value2 "TITLE #4") (vlax-invoke-method (vlax-get-property xlsheet 'Columns) 'AutoFit) ; ; (setq Cells (vlax-get-property xlsheet 'Range "F1")) (vlax-put-property Cells 'Value2 "TITLE #5") (vlax-invoke-method (vlax-get-property xlsheet 'Columns) 'AutoFit) ; ; (setq Cells (vlax-get-property xlsheet 'Range "G1")) (vlax-put-property Cells 'Value2 "REVISION No") (vlax-invoke-method (vlax-get-property xlsheet 'Columns) 'AutoFit) ; (princ) ) Edited July 7, 2020 by CADTutor Moved code to code block Quote
CadICan Posted May 29, 2020 Author Posted May 29, 2020 So, Not nearly the refinement of Fixo or Lee Mac.... but this works. I place all my drawings in a folder. Use Batchit.lsp to run Get_DWG_TitleInfo.lsp on the drawings. Then load and r un OpenExcelFil e.lsp. Thanks to Fixo for his code... this got me down the right path. batchit.lsp Get_DWG_TitleInfo.lsp OpenExcelFile.lsp Quote
BIGAL Posted May 29, 2020 Posted May 29, 2020 Unfortunately I believe Fixo is no longer with us his VBA support solved many problems. Quote
BrianTFC Posted July 7, 2020 Posted July 7, 2020 i would like to download these lisp but everytime i click on them it does nothing. Quote
baduke9 Posted July 7, 2020 Posted July 7, 2020 It says that they have been downloaded multiple times but I can't get them to do anything when I click on them. what am I doing wrong? Quote
CADTutor Posted July 7, 2020 Posted July 7, 2020 4 hours ago, BrianTFC said: i would like to download these lisp but everytime i click on them it does nothing. 1 hour ago, baduke9 said: It says that they have been downloaded multiple times but I can't get them to do anything when I click on them. what am I doing wrong? I've just downloaded them without any problem - could you try again and let me know what browser/OS you are using so I can troubleshoot this? Quote
rlx Posted July 7, 2020 Posted July 7, 2020 are you looking in right folder? Find my downloads in Windows 10 To find downloads on your PC: Select File Explorer from the taskbar, or press the Windows logo key + E. Under Quick access, select Downloads. You can also find your Downloads folder under This PC. maybe reset your security level in your browser (I assume your login account has admin rights?) you know the filename so use windows search... 1 Quote
BrianTFC Posted July 7, 2020 Posted July 7, 2020 rlx, the problem is that when I click on the attachment it doesn't even give me the option to save it to a location. Quote
CADTutor Posted July 7, 2020 Posted July 7, 2020 1 minute ago, BrianTFC said: rlx, the problem is that when I click on the attachment it doesn't even give me the option to save it to a location. By default, your browser may just save to to the download folder, without asking you. Quote
rlx Posted July 7, 2020 Posted July 7, 2020 right click and open in new folder? have this problem on my work too sometimes but they have a reward in the IT department for who can find the most functions to block and he or she will be the irritate king or queen of the month. Maybe try different browser. You can have the new edge browser side to side the standard internet explorer and whenever I have a site that gives me trouble I copy the link , send a picture of my mother-in-law to this site and paste the link in the new edge browser et voila... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.