ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hyperlinks saving error in code (https://www.excelbanter.com/excel-programming/421019-hyperlinks-saving-error-code.html)

ezil

hyperlinks saving error in code
 

I used the following code for saving files from hyperlinks but it saves the
file from which macro is launched and not the file from hyperlink. Help me to
correct the code (dummy hyperlink address given)

Application.DisplayAlerts = False
Application.ScreenUpdating = False
On Error GoTo ErrHandler
For i = 11 To 16
Worksheets("abcd").Select
abc = Cells(i, 3)
url1 = "http://abcd.com/"+abc+"abc.csv"
ActiveWorkbook.FollowHyperlink Address:=url1, _
NewWindow:=False, AddHistory:=True
ActiveWorkbook.SaveAs Filename:= _
"C:\HISDATA\" + abc + ".xls"
Workbooks(abc).Close
label1:
Next i
ErrHandler:
GoTo label1

Jim Cone[_2_]

hyperlinks saving error in code
 

See... http://support.microsoft.com/KB/555375
--
Jim Cone
Portland, Oregon USA



"ezil"
wrote in message
I used the following code for saving files from hyperlinks but it saves the
file from which macro is launched and not the file from hyperlink. Help me to
correct the code (dummy hyperlink address given)

Application.DisplayAlerts = False
Application.ScreenUpdating = False
On Error GoTo ErrHandler
For i = 11 To 16
Worksheets("abcd").Select
abc = Cells(i, 3)
url1 = "http://abcd.com/"+abc+"abc.csv"
ActiveWorkbook.FollowHyperlink Address:=url1, _
NewWindow:=False, AddHistory:=True
ActiveWorkbook.SaveAs Filename:= _
"C:\HISDATA\" + abc + ".xls"
Workbooks(abc).Close
label1:
Next i
ErrHandler:
GoTo label1

Mike Fogleman[_2_]

hyperlinks saving error in code
 

Use ampersand (&), not plus (+) to join a string variable.

url1 = "http://abcd.com/"& abc &"abc.csv"
"C:\HISDATA\"& abc &".xls"


Mike F
"ezil" wrote in message
...
I used the following code for saving files from hyperlinks but it saves the
file from which macro is launched and not the file from hyperlink. Help me
to
correct the code (dummy hyperlink address given)

Application.DisplayAlerts = False
Application.ScreenUpdating = False
On Error GoTo ErrHandler
For i = 11 To 16
Worksheets("abcd").Select
abc = Cells(i, 3)
url1 = "http://abcd.com/"+abc+"abc.csv"
ActiveWorkbook.FollowHyperlink Address:=url1, _
NewWindow:=False, AddHistory:=True
ActiveWorkbook.SaveAs Filename:= _
"C:\HISDATA\" + abc + ".xls"
Workbooks(abc).Close
label1:
Next i
ErrHandler:
GoTo label1





All times are GMT +1. The time now is 01:56 PM.

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