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: 1
Default Error 1004 Paste method of Worksheet class failed


I have a VB COM+ component which exports data from db to a spreadsheet.
The workbook has around 6 sheets which the VB program fills as part of
the export process. It's a huge code with multiple function calls. I
have given code snippets in brief.

Set xlBook = CreateObject("Excel.Application")
xlBook.Workbooks.Open (File_Path)
xlBook.DisplayAlerts = False
....

Set xlsheet = xlBook.Workbooks(1).Worksheets("SheetA")
xlsheet.Activate
xlsheet.Range(strrangearr(0)).Resize(reccount, UBound(recarray, 1) +
1).Value = TransposeDim(recarray)
.....
.....
Set xlsheet = xlBook.Workbooks(1).Worksheets("SheetB")
xlsheet.Activate
xlsheet.Range("PD_attendee_type1").Activate
xlsheet.Range("PD_attendee_type1").EntireRow.Copy
xlsheet.Range("PD_attendee_type1").Offset(intCntr1 - 1,
0).EntireRow.Insert
xlsheet.Paste xlsheet.Range("PD_AT").Offset(intCntr1 - 1, 0).EntireRow,
False

These are 2 ways in which data is copied into the sheets.

I am unable to debug the COM+ component and also the error occurs
irregularly. Any suggestions what could go wrong.

Thanks in advance.


--
skvabbili
------------------------------------------------------------------------
skvabbili's Profile: http://www.excelforum.com/member.php...o&userid=34135
View this thread: http://www.excelforum.com/showthread...hreadid=539055

 
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 1004 Copy method of worksheet class failed Ayo Excel Discussion (Misc queries) 3 March 28th 08 02:05 PM
runtime error 1004 paste method of worksheet class failed wilsoj Excel Programming 12 August 10th 05 08:20 PM
RT Error 1004, Select method of worksheet class failed Dana Sherbondy Excel Programming 2 October 1st 04 03:55 PM
Run Time error 1004 Paste Method of Worksheet Class Failed Ken Nunn Excel Programming 3 June 29th 04 03:23 PM
RUNTIME ERROR '1004' --- Select method of worksheet class failed jawee Excel Programming 2 April 30th 04 06:47 AM


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