LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.dotnet.scripting,microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default XLBook.Save fails in Excel 2007

I have several vb scripts that copy data from csv files to xls files and the
XLBook.Save method worked fine in previous versions of Office. However, in
Excel 2007 I get a "Save method of Workbook class failed" error when
attempting to execute the following:

Dim XL, CSVBook, XLBook
Set XL = CreateObject("Excel.application")
Set CSVBook = XL.Workbooks.Open("CSVfile.csv")
Set XLBook = XL.Workbooks.Open("XLSfile.xls")
CSVBook.Worksheets(1).Range("A1:C100").Copy
XLBook.Worksheets("data").Select
XLBook.Worksheets("data").Range("A1").PasteSpecial
XLBook.Worksheets("data").Range("E1").Select
CSVBook.Worksheets(1).Range("D1").ClearContents
CSVBook.Close False
XLBook.Save ****ERROR HAPPENS ON THIS LINE****
XL.Visible = True


Does anyone know if the syntax has changed or if Excel 2007 uses a different
method?


 
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
Excel in office 2007 fails to start.. HELP pls Arif[_2_] Setting up and Configuration of Excel 1 June 17th 08 09:50 AM
Excel fails on Save/Save As DanG[_2_] Excel Discussion (Misc queries) 11 May 16th 08 02:36 PM
Excel fails to save ChrisH Excel Discussion (Misc queries) 3 January 6th 06 01:30 PM
Excel fails to save properly Rolls Excel Discussion (Misc queries) 1 April 22nd 05 07:00 PM
Save As - Multiple Sheets fails to save as text file Ravee Srinivasan Excel Programming 2 November 10th 03 04:05 PM


All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"