Excel refresh returns "Please enable JavaScript to view the page content."

Adison

New Member
Joined
Jan 7, 2014
Messages
4
Long time Mr. Excel viewer. First time poster. Thanks beforehand.

Here's the problem - Excel refresh returns "Please enable JavaScript to view the page content."

Understand a work around to this is to right click, edit query, click on import. This works 75% of the time. Not all the time - with 25% of the time returning the JavaS error.

However, when attempting to macro around this problem, the resulting macro fails.

With Selection.QueryTable
.Connection = _
"URL;http://[surpressed www.]"
.CommandType = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

Here, ".CommandType = 0" returns a Run-time error '5'. There are some posts on this, but no solution.

When I rem out the ".CommandType..", you guessed it, the Java error returns.

I wrapped a loop around it to run until the error is gone. This loop runs in-definitely.

I've spent about three hours trying to fix this. Again, many thanks for your help.

HELP :)
 
Last edited:
Yes, I'm requesting the price details for a number of shares so I guess that is what is happening. I need to get through the list asap but guess I'll have to give up on using the ASX site. Thanks again for your help.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Yes, I'm requesting the price details for a number of shares so I guess that is what is happening. I need to get through the list asap but guess I'll have to give up on using the ASX site. Thanks again for your help.

I have the same problem.
After a lot of searching I've come up with a fix for my circumstances.
It's not as elegant as the 1 click method I had.

I want the share prices of approximately 18 companies, the All-Ords and other EOD data.
4 Web Queries to the ASX is my norm.
(Also The DOW, S&P500, oil and gold futures. The queries for these still work fine.)

I use Firefox as my main browser.
I installed this Add-on. (I believe there's one for Chrome.)
Dafizilla : Table2Clipboard

Get figures from the ASX.
http://www.asx.com.au/asx/markets/p...&asxCodes=bhp rio anz cba wbc tls wes nab wow
Right click on the resultant table, Table2Clipboard, The whole table, and then paste to a work area in my spreadsheet.
Do it 3 more times. :eek:(
Now I can manipulate the data how I want.

The 4 queries are in the one Bookmarks folder.
I just select 'Open All in Tabs'.

As I said...NOT elegant.
It will have to do until something better comes along.

Cheers
 
Upvote 0
Great that you've come up with a solution.

After my last post, I remembered the ASX allows a query on up to 10 share prices. This has got me around my problem with the use of your code.

Lost count of how much time it's taken to get things back to the way they were but glad you also posted here.

Cheers to you.
 
Upvote 0
This thread is a bit old, but maybe someone is watching.

I've used this process for a week, in parallel.
Figures match my current copy/paste process.

Batch file:
Only takes seconds. Gives you the edited web pages on your pc.
Get the share prices. (still limited to 10 shares)
Delete the Up/Down arrows.(glyphs)
Output 2 html files.
Open your spreadsheet.

Excel 2003:
Creating the queries took forever, but worked.
I just waited and waited, accepting all the page errors that popped up.
Data/Import External Data/Import Data (NOT a web query)
page1.html
[Files of type (*.htm; *.html; *.asp; .....)]

Then the usual process - reference the figures from other tabs.
Once a query is created it seems almost as quick as it was, long, long ago.

Now it's set up.
Double click to run the batch file.
A single click to import the data.
Done.

http://www.mediafire.com/file/9plvsutbk3br741/asx_share_prices.7z
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,772
Members
449,095
Latest member
m_smith_solihull

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