How to build a web query to paste into specified cell

msraga

New Member
Joined
Jun 8, 2011
Messages
3
I am having trouble writing a macro that will copy an entire webpage and paste it in excel. I am trying to use SendKeys right now which probably isn't the best idea. I've never used macros and I need to learn for a new internship, so it is a learning process!!!

PLEASE HELP!! it is greatly appreciated

Here is what I have that I cant get to work:
Code:
[B]Sub OpenIE()
'Open site if it requires a PassWord Model!
Dim IE As Object

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

'Go to this Web Page!
IE.Navigate "http://www.gomeznetworks.com/login.asp"

'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:05"))
'MsgBox "Done"
IE.Visible = True

'Send log-on information!
SendKeys "msraga", True
SendKeys "{TAB}", True
SendKeys "password", True
SendKeys "{ENTER}", True

'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:06"))
'MsgBox "Done"
IE.Visible = True

'Navigate to Settings
IE.Navigate "http://www.gomeznetworks.com/admin/mysettings.asp"
Application.Wait (Now + TimeValue("0:00:03"))
'MsgBox "Done"
IE.Visible = True

'Navigate to Reports
IE.Navigate "http://www.gomeznetworks.com/reports/daily_report.asp"
Application.Wait (Now + TimeValue("0:00:03"))
'MsgBox "Done"
IE.Visible = True

'Navigate to each distinct report

'Navigate to Home Page - Firefox
IE.Navigate "http://www.gomeznetworks.com/reports/daily/perspective.asp?report_id=158363&sendopt=1 "
Application.Wait (Now + TimeValue("0:00:03"))
'MsgBox "Done"
IE.Visible = True

Application.Wait (Now + TimeSerial(0, 0, 2))
SendKeys "^a"
SendKeys "^c"[/B]
[B]ActiveSheet.Range("B2").Select[/B]
[B]SendKeys "^v"
[/B]

'more code that isnt added..
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,224,618
Messages
6,179,916
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top