Help on load the web link into Excel?

E

Eric

Does anyone have any suggestions on loading the web link into Excel?
Following codes is working before, recently when I run the macro, it can
open the wb.Sheets("Industry Indexes"), but fails to copy into Sheets("Temp")
and close it.
Does anyone have any suggestions on what is going wrong?
Thanks in advance for any suggestions
Eric

Dim wb As Excel.Workbook
Set wb = Workbooks.Open("http://main.hsi.com.hk/hsicom/table/dyforma1.xls")
wb.Sheets("Industry Indexes").UsedRange.Copy
ThisWorkbook.Sheets("Temp").Range("A1")
wb.Close False
 
E

Eric

Thank you very much for your reply
I get no error, but the macro stops when the web link file is opened, it
should keep processing copy and close the web link file.
When I create a new worksheet, then it works fine.
I have tried in this afternoon, it works again, but when it works, my
notebook's screen turn off automatically, and I need to press any button to
turn on the screen, but it finished the process of copy and close commands at
this time.
At this moment, I try to run this macro again, it stops again and not
perform the copy and close command, but at this time, the screen did not turn
off automatically. It seems to me that the event of turning off the screen
has something to do with processing the copy and close commands. I ready
don't understand what wrong it is.
Do you have any suggestions on how check what wrong it is based on my
description? If you find my description is not clearly enough, please reply
to me, I will explain more about my situation.
I look forward to your reply
Thank you very much for any suggestions
Eric
 
M

Mike Fogleman

OK, the code you posted had to be modified in my module in order to work. I
made sure that

wb.Sheets("Industry Indexes").UsedRange.Copy
ThisWorkbook.Sheets("Temp").Range("A1")

was all on one line. I assumed you also have it that way but the news reader
split it up into two lines when you posted it.

Mike F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top