Resolved OLE Excel
- How-to
- David Vasconcelos
- PowerBuilder
- Thursday, 11 February 2021 03:24 PM UTC
Several items...
How to copy and paste from one worksheet to another and keep all formatting.
I have tried.
ole_sheet.PasteSpecial("-4104") - Fails Get runtime error.
ole_sheet.PasteSpecial() - runs but does not keep formating
ole_sheet.Paste - runs but does not keep formatting.
Microsoft maco displays
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _False, Transpose:=False
But have not been able to figure out the translation into PB.
also if any one knows how to copy an entire worksheet into a new worksheet that would keep formatting that would be great.
when I tried
Any la_null
Setnull(la_any)
ole_sheet.Copy(la_null,iole_workbook.Application.ActiveWorkBook.WorkSheets[ll_ws]) I get a runtime error
PB2017 R3, Sybase ASE 16, window 10.
*************************************************************************
Closing this found the culprit.
lole_new.Cells.EntireColumn.Autofit - this was causing it. Becuase when coping the headers over there is no data so it was shrinking the columns...
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.