1. Jason Lipman
  2. PowerBuilder
  3. Wednesday, 21 February 2018 19:48 PM UTC

PB 2017 R2, Build 1756

Hello PB Community,

I have the OLE code to paste the contents of a datawindow to an Excel spreadsheet (thank you to all the examples available online!)

I want to copy multiple datawindows into the same worksheet, but pasting always defaults to row/column 1,1.

This does NOT work..

   lole_excel.ActiveWorkbook.Sheets(1).Rows(ll_totrows).Select
   lole_excel.ActiveWorkbook.Sheets(1).Columns(1).Select

Is the GOTO syntax correct? But if so, does someone know the correct syntax?

Of course, if I am off-track altogether, let me hear it!

Thank you!

Jason Lipman

 

Accepted Answer
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 22 February 2018 06:46 AM UTC
  2. PowerBuilder
  3. # Permalink

Your code first selects a whole row, than a whole column. But in sum it doesn't select a single cell.

Use

lole_excel.ActiveWorkbook.Sheets(1).Cells(ll_totrows, 1).Select

to select a single cell.

 

Comment
  1. Jason Lipman
  2. Thursday, 22 February 2018 14:31 PM UTC
Thank you, René. That works! - Jason

  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.