This error happens when I run the function to prepare an xls file
Application
===========
Path and name: C:\Zephir\NwCoge\Sigah.exe (32 bits)
Size: 2,987,520 bytes
Compiler version: Harbour 3.2.0dev (r2008190002)
FiveWin version: FWH 20.08
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 2 mins 30 secs
Error occurred at: 02/10/2020, 12:01:56
Error description: (DOS Error -2147352567) WINOLE/1007 Impossibile trovare la proprietà Paste per la classe Worksheet. (0x800A03EC): Microsoft Excel
Stack Calls
===========
Called from: => TOLEAUTO:PASTE( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOEXCEL( 10385 )
Called from: prog\GesSmg.prg => (b)BTNBAR( 3814 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 713 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 999 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONDOWN( 937 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1814 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2051 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: prog\GesSmg.prg => BROEXC( 3761 )
Called from: prog\GesSmg.prg => GESTIONE( 3592 )
Called from: prog\GesSmg.prg => (b)GESSMG( 45 )
Called from: \servizio\prog\StdGes.prg => (b)STDGES_GESTIONE( 4048 )
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE( 1599 )
Called from: \servizio\prog\StdGes.prg => STDGES:GESTIONE( 4219 )
Called from: \servizio\prog\StdGes.prg => (b)STDGES_ACTIVATE( 1656 )
Called from: ..\source\classes\TSBrowse.prg => TSBROWSE:RBUTTONDOWN( 6882 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1827 )
Called from: ..\source\classes\TSBrowse.prg => TSBROWSE:HANDLEEVENT( 10597 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => SYSREFRESH( 0 )
Called from: .\source\function\MSGRUN.PRG => STOPUNTIL( 71 )
Called from: \servizio\prog\StdGes.prg => STDGES:ACTIVATE( 1899 )
Called from: prog\GesSmg.prg => GESSMG( 185 )
Called from: prog\Main.prg => (b)BUILDMENU( 6443 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1556 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND( 272 )
Called from: => TMDIFRAME:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1097 )
Called from: prog\Main.prg => MAIN( 6025 )
To solve the problem I have eliminated the commented part of the program.
I did not understand why to do a 'paste' operation during the read cycle of the DBF file
when the length of the copy buffer had reached the length of 16000 characters,
instead of doing a single 'paste' operation at the end of the cycle.
- Code: Select all Expand view
if ::oClp:Open()
Eval( bProgress, 0, nDataRows )
do while nRow <= ( nDataRows + 1 ) .and. lContinue
if ! Empty( cText )
cText += CRLF
endif
cText += ::ClpRow( .t., aCols )
// lContinue := ( ::Skip( 1 ) == 1 )
lContinue := nRow < ( nDataRows + 1 ) .and. ( ::Skip( 1 ) == 1 )
nRow ++
*-----------------------------------------------------------------------------------------------
*- Quando si verificava la condizione di : 'Len( cText ) > 16000' accadeva questo errore :
*- Error description: (DOS Error -2147352567) WINOLE/1007
*- Impossibile trovare la proprietà Paste per la classe Worksheet. (0x800A03EC): Microsoft Excel
*-----------------------------------------------------------------------------------------------
*-if Len( cText ) > 16000
*- ::oClp:SetText( cText )
*- oSheet:Cells( nPasteRow, 1 ):Select()
*- oSheet:Paste()
*- ::oClp:Clear()
*- cText := ""
*- nPasteRow := nRow
*-endif
If ( nRow - 2 ) % nStep == 0
if Eval( bProgress, nRow - 2, nDataRows ) == .f.
Exit
endif
SysRefresh()
endif
enddo
if ! Empty( cText )
::oClp:SetText( cText )
oSheet:Cells( nPasteRow, 1 ):Select()
oSheet:Paste()
::oClp:Clear()
cText := ""
endif
Eval( bProgress, nDataRows, nDataRows )
SysRefresh()
endif
endif // ::lExcelCellWise
TIA