CreateNewDocument Method Example

This example creates a new document based on the new hyperlink in the first worksheet and then loads the document into Microsoft Excel for editing. The document is called “Report.xls,” and it overwrites any file of the same name in the \\Server1\Annual folder.

With Worksheets(1)
    Set objHyper = _
        .Hyperlinks.Add(Anchor:=.Range("A10"), _
            Address:="\\Server1\Annual\Report.xls")
    objHyper.CreateNewDocument _
        FileName:="\\Server1\Annual\Report.xls", _
        EditNow:=True, Overwrite:=True
End With