Page 1 of 1
excel control
Posted: Sat Mar 04, 2023 1:01 pm
by drrself
trying my first PureBasic program - struggling to transition from XoJo -
have added Comate Plus - opening an Excel file - it has a number of Blank or empty rows throughout
I want to scan thru the rows and delete the blank rows
is there a Purebasic (or Comate) way to translate the Xojo
Worksheet.Rows(rw). Delete
"rw" being the row number I want to delete
Re: excel control
Posted: Sat Mar 04, 2023 4:58 pm
by pfnuesu
Hi drrself
This would be the equivalent:
Of course you'd need to attribute your worksheet to WS1 first.
Code: Select all
<snip (create comate-object)>
WorkBook = ExcelObject\GetObjectProperty("Workbooks\Add")
<snip>
WS1 = WorkBook\GetObjectProperty("ActiveSheet")
Hope this helps
Best,
Pfnuesu
Re: excel control
Posted: Sun Mar 05, 2023 12:59 pm
by drrself
This worked Great - thanks so much -
I have another snag -
I can "set" the width of a column but have not found the way to "read" the width of an column in the excel
This works to SET the width of a column
exl\SetProperty("Columns('B:B')\ColumnWidth = 20")
this does NOT work to READ the width of a column
nb = exl\GetProperty("Columns('B:B')\ColumnWidth")
"interface method not fount: GetProperty"
I have tried several variations - help please
Re: excel control
Posted: Sun Mar 05, 2023 1:55 pm
by PeDe
This should work with 'GetRealProperty'.
You can find the calls in the file 'COMatePLUS_Residents.pbi'.
Re: excel control
Posted: Sun Mar 05, 2023 2:34 pm
by drrself
that did it - thanks
I have been looking at the Residents -
but.... it hasn't been all that obvious to me