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