How to Create a Hyperlink in Excel Spreadsheet Using VBScript

Someone at the newsgroup asked this question. This is the VBScript that I wrote to accomplish this.

Dim objExcel

Set objExcel = WScript.CreateObject("Excel.Application")

objExcel.Visible = TRUE

objExcel.Workbooks.Open "C:\\bintest.xls"



Dim sLinkAddress

sLinkAddress = ""

objExcel.Workbooks(1).Worksheets(1).Hyperlinks.Add _

    objExcel.Selection, sLinkAddress

objExcel.Workbooks(1).SaveAs "C:\\bintest.xls"


set objExcel = nothing

This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.


  1. hi,

    I am trying to create a worksheet wherein you enter the web address of a site say ex: and upon entering the value, the cell should display only “XYZ” and not the entire web address. Upon clicking that cell, it should take us to that site.

    Can you please suggest some ways to do this?

    Thanks …

Leave a Reply