View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Edwin Tam (MS MVP) Edwin Tam (MS MVP) is offline
external usenet poster
 
Posts: 48
Default how to open a url in a new window from VBA on Excel

The basic statements to open an URL using VAB is:

If Workbooks.Count = 0 Then Workbooks.add
ActiveWorkbook.FollowHyperlink address:="http://www.microsoft.com", NewWindow:=True

Note the first line to add a new workbook if no workbook is currently available. This is not mandatory. But in case there is no workbook available, the FollowHyperlink link will give an error. Use that line if you're working on an add-in. Ingnore that if not.