Hi everyone
Coming form VB6, i'm converting some of my code to PB (PB/Win 9).
So far i'm quite successful, but there's one tiny bit I need help with:
I simply don't get how to insert a horizontal page break in an Excel worksheet.
Here's the code stripped down to this function in the last version I tried.
(excel_dispatch.inc is a newly exported .inc from Powerbasic COM Browser with options set to "Generate Dispatch Interface Only" and Interface Prefix "Int_xls_")
Thanks for your help
Greetings from Switzerland
Markus
Coming form VB6, i'm converting some of my code to PB (PB/Win 9).
So far i'm quite successful, but there's one tiny bit I need help with:
I simply don't get how to insert a horizontal page break in an Excel worksheet.
Here's the code stripped down to this function in the last version I tried.
(excel_dispatch.inc is a newly exported .inc from Powerbasic COM Browser with options set to "Generate Dispatch Interface Only" and Interface Prefix "Int_xls_")
Code:
COMPILE EXE #DIM ALL #INCLUDE "excel_dispatch.inc" ''Objekt-Variablen GLOBAL oExcelApp AS Int_xls__Application GLOBAL oExcelWorkbook AS Int_xls__Workbook GLOBAL oExcelWorkSheet AS Int_xls__WorkSheet 'OLE-Variablen GLOBAL vRead AS VARIANT GLOBAL vWrite AS VARIANT GLOBAL vTrue AS VARIANT GLOBAL vRange AS VARIANT FUNCTION PBMAIN () AS LONG vTrue = -1 '' Excel öffnen oExcelApp = ANYCOM $PROGID_Excel_Application IF ISFALSE ISOBJECT(oExcelApp) OR ERR THEN MSGBOX "!!?!",, "ErrorMsg" EXIT FUNCTION END IF '' Worksheet referenzieren OBJECT CALL oExcelApp.WorkBooks.Add TO oExcelWorkbook vWrite = 1 OBJECT GET oExcelWorkBook.WorkSheets(vWrite) TO oExcelWorkSheet vRange = "a1" vWrite = "This is a test!" OBJECT LET oExcelWorksheet.Range(vRange).value = vWrite vRange = "a6" vWrite = "This as well!" OBJECT LET oExcelWorksheet.Range(vRange).value = vWrite ''Seitenumbruch? '-------------------------- '''That's the part in question vWrite = "rows(5)" OBJECT CALL oExcelWorksheet.HPageBreaks.Add (vWrite) '-------------------------- OBJECT LET oExcelApp.Visible = vTrue vWrite = 2 ''xlPageBreakPreview OBJECT LET oExcelApp.ActiveWindow.View = vWrite END FUNCTION
Greetings from Switzerland
Markus
Comment