Skip to Content
0
Sep 05 at 01:10 PM

Powerbuilder, OLE object, Excel, problem in copy and paste

44 Views

Hi All,

I found that if something is copied in clipboard outside of the program while below program is running between "copy" and "paste", then the "something" is pasted in the final output file which is not correct.

Is there any way to avoid it? Using a shared clipboard at the same time is the problem here. but I can't find solution.

Please advise. Thank you in advance.

// Combine Sheets into one excel file

FOR li_n = 1 TO 8

lole_TempWorkBook = lole_excel.WorkBooks.Open(is_currDirectory+as_filename_tab[li_n]) lole_TempWorkBook.WorkSheets(1).Cells.Select

lole_excel.CutCopyMode = False

lole_TempWorkBook.WorkSheets(1).Cells.Copy <=========================

lole_MainWorkBook.Activate

lole_sheet = lole_MainWorkBook.WorkSheets(li_n)

lole_sheet.Name = ls_tabname[li_n]

lole_sheet.Paste <=========================

//lole_sheet.Cells.EntireColumn.AutoFit

lole_excel.CutCopyMode = False

lole_TempWorkBook.Close(False)

NEXT