In vb I have the code. Thanks anyway.
In C++ I am trying something like:
icl_hyperlinks.Add(icl_oWksSheet.GetRange(COleVariant("A2"),
COleVariant("A2")), "c:\\test.txt", covOptional, covOptional,
COleVariant("test"));
But this way don't write any hyperlink.
"Birgit" wrote:
> Hi Rui,
>
> Here is what I used recently from VBA
>
> Set myHyperlink =
> ActiveWorkbook.Worksheets("Inhoudsopgave").Hyperlinks.Add(Anchor:=myrange.Offset(i,
> 1).Range("A1"), Address:="", SubAddress:="'" & Worksheets(i).Name & "'!A1")
> myHyperlink.TextToDisplay = "my Text here"
>
> the argument anchor is a range (in my case I insert a number of hyperlinks
> in a loop).
> Sorry, this is no C++ but I'm sure you'll manage a LPDISPATCH to a
> range-object.
>
> The VBA-help of excel is an excellent source of information to the excel
> object. There is very little C++ info around.
>
> HTH,
> Birgit
>
> "Rui Oliveira" <(E-Mail Removed)> schreef in bericht
> news:B726EB93-38E4-44B5-886C-(E-Mail Removed)...
> > C++ Excel automate, add hyperlink
> >
> > How can I add a hyperlink in excel automation?
> >
> > We have function "Hyperlink.Add", but I don't know what insert in first
> > argument.
> >
> > LPDISPATCH Add(LPDISPATCH Anchor, LPCTSTR Address, const VARIANT&
> > SubAddress, const VARIANT& ScreenTip, const VARIANT& TextToDisplay);
> >
> > Anyone have some sample code?
> >
> > Thanks,
> > Rui
> >
>
>
>
|