locked
Application.Workbooks("try.xls").Close problem! RRS feed

  • Question

  • Hi,

    I'm trying to close an open excel using the code :

    Application.Workbooks("try.xls").Close

    This above line works in Excel 2007 but not in Excel 2003. It gives me this error: "Subscript out of range"

    Can anyone give me a suitable code that would work in Excel 2003?

    Thanks
    Justin
    Monday, October 3, 2011 2:53 PM

Answers

  • Thanks Cimjet.. I got my answer!.. It does work but my application posed a problem... It's all fine now thanks!

    Justin

    • Marked as answer by danishani Saturday, February 18, 2012 12:37 AM
    Monday, October 3, 2011 4:20 PM

All replies

  • Hi Justin

    I use XL03 and your script works fine but you will get that error if the workbook "try.xls is not open.


    Cimjet
    Monday, October 3, 2011 3:35 PM
  • Hi Cimjet,

    I've tried it many times but it doesn't seem to work for  me... It gives me the Run time error 9 - Subscript out of range

    Thanks 

    Justin

    Monday, October 3, 2011 3:48 PM
  • Thanks Cimjet.. I got my answer!.. It does work but my application posed a problem... It's all fine now thanks!

    Justin

    • Marked as answer by danishani Saturday, February 18, 2012 12:37 AM
    Monday, October 3, 2011 4:20 PM