Home > Software engineering >  C how to EXCEL in a column set to link
C how to EXCEL in a column set to link

Time:10-02

MFC list form content in output to EXCEL, the last column need to be set to hyperlinks, download the code from the CSDN resources, since the code is not complete, not adjustable, want to ask next this setting anyway?

Here are online to download code:

Put a hyperlink//
Cstrings cc.//hyperlinks ¨ address
Cc=_T (" http://www.baidu.com/index.php? Tn=maxthon2 & amp; Ch=3 ");//
Range. AttachDispatch (sheet. GetRange (_variant_t (_T (" C2 ")), _variant_t (_T (" C2 "))));//get area
Links. AttachDispatch (range. GetHyperlinks ());//get the Hyperlinks object
The links. The Add (range, cc, _variant_t (_T (" ")), _variant_t (_T (" ")), _variant_t (_T (" ")));//set the hyperlink

CodePudding user response:

How do the following VBA is converted into c + + code

VBA code is:
Sub hong1 ()


ActiveSheet. Hyperlinks. Add Anchor:=Selection, Address:=
"D: \ work \ 0. JPG", _
TextToDisplay:=_
"D: \ work \ 0. JPG",
R17 Range (" "). Select

End Sub

CodePudding user response:

Excel macro recording, manual operation, reference macro code modify the code

CodePudding user response:

refer to the second floor zgl7903 response:
excel macro recording, manual operation, refer to the macro code modify the code


How do the following VBA is converted into c + + code

VBA code is:
Sub hong1 ()


ActiveSheet. Hyperlinks. Add Anchor:=Selection, Address:=
"D: \ work \ 0. JPG", _
TextToDisplay:=_
"D: \ work \ 0. JPG",
R17 Range (" "). Select

End Sub

CodePudding user response:

 this example to cell A5 to add hyperlinks, 

With Worksheets (1)
. Hyperlinks. Add Anchor:=Range (" a5 "), _
Address:="http://example.microsoft.com", _
ScreenTip:="Microsoft Web Site," _
TextToDisplay:="Microsoft"
End With

This example to add a cell A5 E-mail hyperlink,

With Worksheets (1)
. Hyperlinks. Add Anchor:=Range (" a5 "), _
Address:="HTTP://mailto:[email protected]? Subject=hello, _
"ScreenTip:="Write us today," _
TextToDisplay:="Support"
End With

CodePudding user response:

You have a look at the links in the download the source code define not line?
  • Related