Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subscript out of Range Steve Excel Discussion (Misc queries) 3 April 15th 09 04:01 PM
Error:Subscript out of range Jay Excel Discussion (Misc queries) 1 April 10th 08 10:25 PM
what does 'Subscript Out of range' mean?? Gary Excel Worksheet Functions 2 March 22nd 07 01:33 AM
9: Subscript out of range jenz21985 Excel Discussion (Misc queries) 6 May 5th 06 03:36 PM
Subscript out of range error moglione1 Excel Discussion (Misc queries) 2 August 30th 05 01:21 PM


All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"