Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default workbook error - please help

why does

workbooks("book1.xls").close

(book1 is open in the current instance of excel, code is in book2)

generates a subscript out of range error - why? i have tried specifying
savechanges = .... but this is an optional argument i believe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default workbook error - please help

Sub closeit()
Workbooks("Book1").Saved = True
Workbooks("Book1").Close
End Sub

--
Gary''s Student - gsnu2007q


"PBcorn" wrote:

why does

workbooks("book1.xls").close

(book1 is open in the current instance of excel, code is in book2)

generates a subscript out of range error - why? i have tried specifying
savechanges = .... but this is an optional argument i believe

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 when opening a workbook Jamie Excel Programming 0 November 7th 07 05:50 PM
error: Excel encountered an error and had to remove some formatting to avoid corrupting the workbook; please recheck your formatting carefully Keith Excel Programming 0 January 31st 07 05:38 PM
on error in whole workbook ? Pierre via OfficeKB.com[_2_] Excel Programming 2 October 29th 05 08:28 AM
Error when Open WorkBook tetors_2002[_5_] Excel Programming 1 May 17th 04 06:10 PM
Workbook reference error R Avery Excel Programming 3 April 14th 04 01:57 PM


All times are GMT +1. The time now is 06:40 AM.

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"