ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CreateNewDocument : an small but interesting discovery from office (https://www.excelbanter.com/excel-programming/329829-createnewdocument-small-but-interesting-discovery-office.html)

zhuge

CreateNewDocument : an small but interesting discovery from office
 
Hi, all newcomers in using office VBA

I wonder this simple sentence to create new documents and add to excel
activecell will defnintely useful for those don't know it, and I also cannot
find it using search engine here.
(I even just know this minutes ago, it is even not in help files of VBA that
I solely rely on)

On error resume next
Set ObjHyper = _
.Hyperlinks.Add(Anchor:=ActiveCell, _
Address:="C:\test.xls")
ObjHyper.CreateNewDocument _
FileName:="c:\test.xls", _
EditNow:=True, Overwrite:=False

--
a scientist


All times are GMT +1. The time now is 04:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com