Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-30-2012, 07:14 AM
excelledsoftware excelledsoftware is offline open hyperlink in new tab Windows 7 64bit open hyperlink in new tab Office 2003
IT Specialist
open hyperlink in new tab
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default open hyperlink in new tab

hello everyone I am using excel 2003 and would like some vba code on opening several websites in new tabs for internet explorer. I have the following code.

Sub urltabs ()
const navopeninnewtab = &H800
set tabby = createobject ("internetexplorer.application")
tabby.visible = true
tabby.navigate "http://www.google.com"


tabby.navigate "http://www.yahoo.com", clng(navopeninnewtab)
tabby.navigate "http://www.msn.com", clng(navopeninnewtab
end sub

everything works great with this code but I want the user to be able to put the urls in cells rather than change them in the vba editor how can I accomplish this?
Reply With Quote
  #2  
Old 07-03-2012, 04:46 AM
macropod's Avatar
macropod macropod is offline open hyperlink in new tab Windows 7 64bit open hyperlink in new tab Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You can use an InputBox, but you'll need to add code that validates whatever the user inputs.

StrHlink = InputBox("What is the URL to use?" & vbcr & _
"e.g: http://www.google.com","Navigation Input")
'validation code goe here
tabby.navigate StrHlink
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
open hyperlink in new tab Using Hyperlink to open Word Document at Specific Header rossi45 Word 2 05-04-2012 06:03 PM
HyperLink help please malfromcessnock Excel 6 12-24-2011 11:43 PM
open hyperlink in new tab Hyperlink Mahmuz Word 2 05-04-2011 10:59 AM
Open DOCX in Word 2007 & Open DOC in Word 2003 wilde_37 Office 0 02-03-2009 12:37 AM
I cannot open a hyperlink in an office 2003 program ArmandoS Office 3 11-26-2005 12:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft