Hello,
I'm very sorry but I might have asked this question before. Unfortunately I can't find it anymore.
But can someone tell me how to add or delete lines in an Excel worksheet?
Thank you very much in advance for any help.
Excel and FiveWin
Excel and FiveWin
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Re: Excel and FiveWin
Hi Michel,
please, try this for example row #4:
Regards,
Detlef
please, try this for example row #4:
Code: Select all | Expand
oSheet := oExcel:Get( "ActiveSheet" )
oSheet:Rows( 4 ):Delete()
oSheet:Rows( 4 ):Insert()
Detlef
- karinha
- Posts: 7935
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Excel and FiveWin
See if it helps:
Regards, saludos.
Code: Select all | Expand
// C:\FWH..\SAMPLES\EXCELPRV.PRG
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL oPrn, oFont, nRow, nCol
USE STATES NEW SHARED
STATES->( StatesReport() )
CLOSE STATES
RETURN NIL
STATIC FUNCTION StatesReport()
LOCAL oPrn, oFont, nRow
GO TOP
PRINT oPrn PREVIEW
// AQUI LIGA O EXCEL.
oPrn:bToExcel := {|| ( Alias() )->( StatesToExcel() ) }
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 10 OF oPrn
PAGE
nRow := 1
WHILE .NOT. Eof()
SYSREFRESH()
@ nRow, 5.0 PRINT TO oPrn TEXT FIELD->CODE SIZE 1, 0.4 CM FONT oFont
@ nRow, 6.0 PRINT TO oPrn TEXT FIELD->NAME SIZE 10, 0.4 CM FONT oFont
nRow += 0.5
SKIP
ENDDO
ENDPAGE
ENDPRINT
RELEASE FONT oFont
GO TOP
RETURN NIL
STATIC FUNCTION StatesToExcel()
LOCAL oExcel, oBook, oSheet, nRow
oExcel := ExcelObj()
oExcel:ScreenUpdating := .F.
oBook := oExcel:WorkBooks:Add()
oSheet := oExcel:ActiveSheet
GO TOP
nRow := 1
WHILE .NOT. Eof()
SYSREFRESH()
oSheet:Cells( nRow, 1 ):Value := FIELD->CODE
oSheet:Cells( nRow, 2 ):Value := FIELD->NAME
nRow++
SKIP
ENDDO
GO TOP
oSheet:Columns( 1 ):AutoFit()
oSheet:Columns( 2 ):AutoFit()
oExcel:ScreenUpdating := .T.
oExcel:Visible := .T.
RETURN NIL
// FIN / END
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Excel and FiveWin - Solved
Thanks a lot for your help.
Problem solved.
Problem solved.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773