0
Votes
Undo
  1. David Vasconcelos
  2. PowerBuilder
  3. Thursday, 11 February 2021 15: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...

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Thursday, 11 February 2021 18:24 PM UTC
  2. PowerBuilder
  3. # 1

Thanks for sharing the solution: "lole_new.Cells.EntireColumn.Autofit - this was causing it.  Because when coping the headers over there is no data so it was shrinking the columns..."

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.