Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default "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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default "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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default "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" wrote in message
...
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
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
Error Message "Subscript our of range" gsmclang Excel Discussion (Misc queries) 1 April 5th 07 06:59 PM
FileCopy Command Giving "Subscript Out of Range" Error Message Jim Hagan Excel Programming 2 June 15th 05 06:07 PM
"Subscript out of range Runtime Error 9" teresa Excel Programming 1 December 14th 04 10:22 PM
SaveAs "subscript out of range" error (COM - SOAP) Matthia Excel Programming 0 July 11th 03 07:01 AM
SaveAs "subscript out of range" error (COM - SOAP) jaf Excel Programming 0 July 10th 03 07:59 PM


All times are GMT +1. The time now is 03:42 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"