Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Subscript out of range
I will appreciate any one's help on this one :
I found this helpfull macro for downloading URL (Hyperlink in column A) to a local directory naming the downloaded file with the text in Column D . By changing it a bit I have tried "making" it loop alog the line2 Unfortunately I couldn't go any further than line 9 - Run-time error '9' - subscript out of range. I found it is something to do with the declaration of array or other parameters this Macro begin with ( even simple macros that work well - like row count - will stop at row 9 when these declarations are declared. How can I make it go further down ? Private Declare Function URLDownloadToFile _ Lib "urlmon" Alias "URLDownloadToFileA" ( _ ByVal pCaller As Long, _ ByVal szURL As String, _ ByVal szFileName As String, _ ByVal dwReserved As Long, _ ByVal lpfnCB As Long) As Long ' Retreves COA frm Acros and saves it to P\system\mail\COANO.PDF Sub SAVEURL () Dim COANO, row, x, y, z, totalrows Dim FolderName As String Dim URL As String Dim FName As String x = ActiveCell.row y = ActiveCell.Column z = 0 Do While Cells(x, y).Value < "" x = x + 1 z = z + 1 row = x FolderName = "C:\TEST" URL = Range("A2:A100").Hyperlinks(row).Address FName = FolderName & "\" & (Cells(x, 4).Value) & ".pdf" URLDownloadToFile 0&, URL, FName, 0&, 0& Cells(x, 5).Value = x Loop End Sub ------ Please help ! OKHM |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Subscript out of Range | Excel Discussion (Misc queries) | |||
Error:Subscript out of range | Excel Discussion (Misc queries) | |||
what does 'Subscript Out of range' mean?? | Excel Worksheet Functions | |||
9: Subscript out of range | Excel Discussion (Misc queries) | |||
Subscript out of range error | Excel Discussion (Misc queries) |