Run-time error '91':

jc0r

Board Regular
Joined
Mar 16, 2009
Messages
124
Hi all, i have an error which i can't seem to fix.

I have a module which contains the following code. I am struggling with the procedure CopyData(). It works when the sheet "Raw Data" is active, however, when it is not, i receive the error on the green line highlighted in the code. Making the "Raw Data" sheet active is not an option as i need to work in other sheets whilst this procedure is been called.

Does anyone have any suggestions please

Code:
Sub RefreshURL_Click()link_name = Sheets("Raw Data").Range("F2")
Call Sheets("Raw Data").WebBrowser1.Navigate(link_name)
End Sub
Sub CopyData()
Sheets("Raw Data").WebBrowser1.Refresh
Sheets("Raw Data").WebBrowser1.Copy
[COLOR=#008000]Sheets("Raw Data").Range("E34").Value = Sheets("Raw Data").WebBrowser1.Document.Body.InnerText[/COLOR]
End Sub
 
I have tried web query but the site i use is mostly java and web query can't pull any of the information off i need. Automating IE is not an option as i have 16 instances of this workbook open and it refreshes every 5 seconds. I can't seem to find any info or a solution to the problem the only thing i can do is put the WebBrowser onto the same page as i work on in Excel. Many thanks for your patience with this Norie
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

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