LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Add method of "Sheets" class fails

Hi all,
I am trying to insert a worksheet from one excel workbook to another
excel workbook. The source excel worksheet is of the size 102 MB. So opening
the worksheets in the destination excel workbook and then copying is taking
too much time. So I tried saving the source worksheet as an excel template
(.xlt file) and then tried adding this template to the destination workbook
with the following code :

objExcel = New Excel.Application
objBooks = objExcel.Workbooks
...
objBooks.Open("D:\destExcel.xls")
objBooks.Item(1).Sheets.Add( "D:\sourceExcel.xlt")
....

The Sheets.Add method fails in the above piece of code. Does anybody know
the reason ?
I would also like to know if there is an efficient method of copying a large
sized excel worksheet from one workbook to another without actually having to
open the source worksheet.

Thanks in anticipation,
CodeKracker.
 
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
"Select method of Range class failed" Error Ayo Excel Discussion (Misc queries) 3 September 2nd 08 07:58 PM
XL2003 "paste method of worksheet class failed" Chuck Elsham Excel Programming 11 May 13th 05 12:57 PM
Error Message "Select method of worksheet class failed" philc Excel Programming 5 May 4th 05 08:07 AM
VBA error 1004 "Select method of Range class failed" Matt J Excel Programming 6 July 3rd 04 10:05 PM
Error 1004, "select method of range class failed" paritoshmehta[_11_] Excel Programming 3 May 6th 04 10:09 PM


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