|
-
May 11th, 2005, 05:02 AM
#1
Thread Starter
New Member
Pastespecial problem on different builds
Hi,
I have a code which after press button, create new workbook and copy part of one workboot to new workbook. Problem is that there are used merged cell. The script work fine on Excell 2002 (10.6713.6626) SP3, but on XP 2002(10.4524.4219) SP-2 (even if it is updated to SP3) ends in error 1004. I am not able to find any other difference between PC where code works and where not. If there is anyone who knows this kind of problem please help me.
Part of code (the line, where code is interupted is marked red)
For i = 0 To 19
Sheet14.Range(Sheet14.Cells(1 + i, 8), Sheet14.Cells(1 + i, 8)).Copy
NewBook.Sheets(a).Range(NewBook.Sheets(a).Cells(k + i, 8), NewBook.Sheets(a).Cells(k + i, 8)).PasteSpecial xlPasteFormats, xlPasteSpecialOperationNone, False, True
NewBook.Sheets(a).Range(NewBook.Sheets(a).Cells(k + i, 8), NewBook.Sheets(a).Cells(k + i, 8)).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
NewBook.Sheets(a).Range(NewBook.Sheets(a).Cells(k + i, 8), NewBook.Sheets(a).Cells(k + i, 9)).Merge True
Next i
Thanks to all in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|