View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Maxi[_2_] Maxi[_2_] is offline
external usenet poster
 
Posts: 94
Default Need help with macro

Dear Joel,

I was unwell... could not reply. I still get the same error. I checked
my companies, they are correct and returns output on the website. A
strange thing is that when I get the error "Object variable or With
block variable not set" on line : For Each MyRow In DataTable.Rows, I
click "Debug" - go to the vba code, shift the yellow arrow little
above and keep it on the line Set DataTable = Tables(tableNum) then I
press F8 till it crosses the line For Each MyRow In DataTable.Rows
then I press F5 and everything works

This happens lot of times. If you want, I can send you the list of all
1272 companies in an attachment.

Thanks


On May 6, 3:58*pm, joel wrote:
Try the macro with the original companies that you posted. *i think the
problem is one of the compnies in your list doesn't exist or is returning bad
data. *The code worked perfectly on my PC at home. *At work I'm having a
problem but I think it is due to the latest updates are not installed on my
PC at work. *Let me know which company isn't working. Go to the website and
verify that the company Symbol is a valid symbol.



"Maxi" wrote:
I get error "Object variable or With block variable not set" on line :
For Each MyRow In DataTable.Rows ????


On May 6, 4:17 am, joel wrote:
I couldn't get the query top work. *Instead of using an internet explorer to
get the data. *It puts the results on sheet 1 using Column A and Column B
from sheet 2.


Sub WebQuery()


With Sheets("Sheet1")- Hide quoted text -


- Show quoted text -