VBS add hyperlink in Excel

Need to handle this situation when design framework. please refer the below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Dim objExcel
Set objExcel = WScript.CreateObject("Excel.Application")

objExcel.Visible = TRUE
objExcel.Workbooks.Open "C:\test.xlsx"
objExcel.Workbooks(1).Activate
objExcel.Workbooks(1).Worksheets(1).Range("A1").Select

Dim sLinkAddress
sLinkAddress = "http://www.izheyi.com"

objExcel.Workbooks(1).Worksheets(1).Hyperlinks.Add objExcel.Selection, sLinkAddress
objExcel.Workbooks(1).SaveAs "C:\test.xlsx"
objExcel.Quit

set objExcel = nothing

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!