+ Reply to Thread
Results 1 to 5 of 5

Subscript Out of Range

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    35

    Subscript Out of Range

    Hi,

    I have a macro that i run every day, and every day it has run smoothly no problem for over a month, today however it decided to break.

    The issue seems to be Workbooks("workbookname").<Anything> seems to be throwing a subscript out of range error.
    If i were to change this to Workbooks("workbookname.xls").<Anything> this seems to work, the question is, why would it now decide it can't run this code when it's been running successfully every day so far.

    I can go in and change all this code but i would rather be able to get it running again how it used to.

    Regards,

    Andy

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Subscript Out of Range

    Whether the workbook is named as workbookname.xls.xls?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Subscript Out of Range

    Andy

    Can you post the code?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    07-16-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Subscript Out of Range

    Sixthsense , Thanks for that idea. Its not the problem, but i realized the solution soon as i read it. I altered my computer today to not hide file extensions for know extension types which i didn't previously. I hadn't thought this would change how visual basic treats it's object names, apparently it does.

    Anyway, problem solved. Thanks!!

    Andy

  5. #5
    Registered User
    Join Date
    07-16-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Subscript Out of Range

    [Double Posted by mistake]

+ 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