Need help to open a web page through Macro

chaitanyat2001

New member
Local time
Today, 15:35
Joined
Jun 2, 2008
Messages
7
Hi Guys,
I am new to Macros. I need to load a web page when a macro is fired. So I am trying with the above code. But I am getting run time error 424 as Object Required with the above code. I can't understand where I am going wrong. I am trying the following code.

Private Sub Command0_Click()
Command0.HyperlinkAddress = "http://www.bbc.co.uk"
End Sub


Thanks in advance.
Chaitanya
 
Just use this:

Code:
FollowHyperlink "http://www.bbc.co.uk"
 
Thanks a ton

Thanks very much for the quick reply.

--
Chaitanya
 
Again help

Thank you for yesterday's reply. But I need your help again. I am using the code as following.

Sub Visual_Macro()
FollowHyperlink "http://www.bbc.co.uk"
End Sub


Again, I am calling the above macro - Visual_Macro from a Visio page. But when the macro is called, it is giving compile error as :
"Sub or Function not defined".

So please help me again, again thanks in advance.

--
Chaitanya
 
Again, I am calling the above macro - Visual_Macro from a Visio page.
From a VISIO page? This is an Access forum, not a Visio forum. The code I gave is for Access. If you need for another program, you need to post in the Other Software section and you need to be specific.
 
Sorry

Sorry for posting in wrong forum, but it seems more of Macro syntax problem, rather than a Visio problem.
So if you find any problem with the above code, please let me know. I am very thankful to you for providing assistance.
 
Chaitanyat2001,
the command Followhyperlink is peculiar to access, which is why it will not work in Visio. although all the Office applications use VBA, each has its own object model which means each has its own individual objects that are appropriate to the application. Even though some overlap, you cannot rely on it.
try this:
Code:
Private Sub Visual_Macro()
    dim ie as object
    Set ie = CreateObject("InternetExplorer.application")
    With ie
        .MenuBar = False
        .Toolbar = False
        .AddressBar = False
        .Navigate "http://www.bbc.co.uk"
        .StatusBar = False
        While .Busy
            DoEvents
        Wend
        .Visible = True
    End With
end sub

HTH,
Chris
 
Thanks

Hey Chris,
Thank you very much for giving the fundamental details. I appreciate that. Your code provided is working fine. Thanking again.


Chaitanya
 

Users who are viewing this thread

Back
Top Bottom