TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Tramber on March 30, 2006, 04:27:03 AM
-
This is not easy I guess...
I know how to read XL cells values. that's no difficulty for me.
BUT. I'm not able to get the hyperlink written in that Cell dispite of my strong efforts.
(setq hypl(msxl-get-Hyperlinks (msxl-get-range *xlapp* "F21")))
returns #<VLA-OBJECT Hyperlinks 0024be0c>
but it seems to me that I can't do anything of it.
I tried (vla-item hypl 0) or (vla-get-url hypl),..etc...
How to read the link written in an XL cell....from AutoCAD ? :?
-
try:
(vlax-for Lnk hypl
(terpri)
(princ (vlax-get Lnk 'Name))
)
-
Very nice of you.
But it gives the string corresponding to the text.
However, you inspired me !
(vlax-for Lnk hypl(setq voir lnk))
(msxl-get-Address voir)
And I can get "../../../COMMUN/AABCAD/SAUV230106/Balancement/remb005.jpg", for exemple, wich would be perfect if only XL would have had been nice enough to also give the name of the directory drive.
But thank you, I made a good step
-
I also tried this
(vlax-for Lnk hypl(setq voir lnk))
(setq catchit (vl-catch-all-apply 'msxl-get-Address voir))
(vl-catch-all-error-message catchit)
I did it in case the cell is empty of hyperlink but it doesn't seem to work
Hard :-P
-
Using the MSX-Excel utilities that Marc'Antonio Alexi put together and posted to numerous newsgroups and a small test Excel file whose cell A:1 has a hyperlink and B:1 does not this works for me without error:
(setq #ExcelImpAllTypLib t)
(msx_loadtypelib)
(msx_openexist "c:\\test.xls" t)
(setq cell1 (msx_getsheetcell 1 1))
(setq cell2 (msx_getsheetcell 1 2))
(setq h1 (vla-get-hyperlinks cell1)
h2 (vla-get-hyperlinks cell2)
)
(vlax-for link h1
(msxp-get-Address link)
)
(vlax-for link h2
(msxp-get-Address link)
)
and returns:
_$
Initializing Microsoft Excel 2000...
T
"\\\\Imaging\\c\\Land Projects 3\\2002\\22115 Dennis and Barnes\\Documents\\lotcalcs.doc"
nil
_$
-
Thanks, Jeff for helping me out, I hadn't the time to complete my answer... :-)
-
cell A:1 has a hyperlink and B:1 does not this works for me without errot
My syntax :
(vlax-for Lnk hypl(setq voir lnk))
(msxl-get-Address voir)
Was not very clever I confess.
Thanks to all