+ Reply to Thread
Results 1 to 3 of 3

"Subscript out of range" error for: Workbooks("Test1.xls").Save

  1. #1
    Just12341234
    Guest

    "Subscript out of range" error for: Workbooks("Test1.xls").Save

    I am trying to save an open workbook (Test1.xls) using code in a second open
    workbook (Test2.xls). I can not figure out why the following line generates
    a "Subscript out of range" error. As far as I can tell My syntax is exactly
    as the help indicates that is should be.

    Workbooks("Test1.xls").Save

    I am stuck! Any help would be much appreciated.

    Thanks,
    Dave

  2. #2
    Norman Jones
    Guest

    Re: "Subscript out of range" error for: Workbooks("Test1.xls").Save

    Hi Just12341234,

    I could only replicate your error if the second workbook was not open or if
    the second workbook's name differed fom the name used in the code.

    In this latter respect, look for a subtle difference such as an initial or
    trailing space and look both at the workbook name and the name used in your
    code to ensure that the are identical.

    ---
    Regards,
    Norman



    "Just12341234" <[email protected]> wrote in message
    news:[email protected]...
    >I am trying to save an open workbook (Test1.xls) using code in a second
    >open
    > workbook (Test2.xls). I can not figure out why the following line
    > generates
    > a "Subscript out of range" error. As far as I can tell My syntax is
    > exactly
    > as the help indicates that is should be.
    >
    > Workbooks("Test1.xls").Save
    >
    > I am stuck! Any help would be much appreciated.
    >
    > Thanks,
    > Dave




  3. #3
    Just12341234
    Guest

    Re: "Subscript out of range" error for: Workbooks("Test1.xls").Sa

    I am using WinXP Pro, Excel2003, code is in the Activate sub of "ThisWork"
    object.

    I have checked the spelling and tried on 2 computers. Perhaps I should try
    from a different subroutine or use a different function.

    Any other ideas?

    Thanks,
    Dave


    "Norman Jones" wrote:

    > Hi Just12341234,
    >
    > I could only replicate your error if the second workbook was not open or if
    > the second workbook's name differed fom the name used in the code.
    >
    > In this latter respect, look for a subtle difference such as an initial or
    > trailing space and look both at the workbook name and the name used in your
    > code to ensure that the are identical.
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Just12341234" <[email protected]> wrote in message
    > news:[email protected]...
    > >I am trying to save an open workbook (Test1.xls) using code in a second
    > >open
    > > workbook (Test2.xls). I can not figure out why the following line
    > > generates
    > > a "Subscript out of range" error. As far as I can tell My syntax is
    > > exactly
    > > as the help indicates that is should be.
    > >
    > > Workbooks("Test1.xls").Save
    > >
    > > I am stuck! Any help would be much appreciated.
    > >
    > > Thanks,
    > > Dave

    >
    >
    >


+ 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