+ Reply to Thread
Results 1 to 5 of 5

subscript out of range

  1. #1
    Registered User
    Join Date
    05-18-2005
    Posts
    17

    subscript out of range

    I have a spreadsheet in excel named "writeoff" and I print every month a report from a website in excel format.
    then i have a macro to link the report printed from website by the way name of file is "ReportProxyServlet" to cells on writeoff sheet by account number.

    But every time i run the macro I am getting this error "run time error 9, subscript out of range".
    I am attaching the two files.

    here it's the code:

    Please Login or Register  to view this content.
    thank you
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,747

    Re: subscript out of range

    The workbook ReportProxyServlet is not open when you run this macro. If this file exists you need to open it first to be able to refer to it in the Workbooks collection.

    Modify your code to look like this. This assumes that the file is in the same folder as this workbook. If not, modify the call to Open to include the correct path:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-09-2010
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: subscript out of range

    Thank you.

    I modified with your suggestion don't get error anymore but the amounts from "ReportProxyServlet" report doesn't transfer to column e on "WRITEOFF" worksheet.

    for exam writeoff sheet has a column with account numbers that match ReportProxyServlet accounts number, so I want the macro to look for the accounts # that have amounts to transfer to writeoff sheet.

    thanks again.

  4. #4
    Registered User
    Join Date
    07-09-2010
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: subscript out of range

    I thought about it, and i think what need help is in the same code to add vlookup function to look for the account find the amount and post it to to writeoff she in the in the right cell.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,747

    Re: subscript out of range

    Your new question is not related to your original question. You may be a better response by starting a new thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1