ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help on load the web link into Excel? (https://www.excelbanter.com/excel-programming/408469-help-load-web-link-into-excel.html)

Eric

Help on load the web link into Excel?
 
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

Mike Fogleman[_2_]

Help on load the web link into Excel?
 
It worked perfectly for me. Do you get an error?

Mike F
"Eric" wrote in message
...
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




Eric

Help on load the web link into Excel?
 
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

"Mike Fogleman" wrote:

It worked perfectly for me. Do you get an error?

Mike F
"Eric" wrote in message
...
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





Mike Fogleman[_2_]

Help on load the web link into Excel?
 
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
"Eric" wrote in message
...
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

"Mike Fogleman" wrote:

It worked perfectly for me. Do you get an error?

Mike F
"Eric" wrote in message
...
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








All times are GMT +1. The time now is 12:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com