excel control

Just starting out? Need help? Post your questions and find answers here.
drrself
New User
New User
Posts: 3
Joined: Sat Mar 04, 2023 12:44 pm

excel control

Post 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
pfnuesu
New User
New User
Posts: 9
Joined: Tue May 03, 2022 8:17 pm

Re: excel control

Post by pfnuesu »

Hi drrself

This would be the equivalent:

Code: Select all

WS1\Invoke("Rows('5:5')\delete") 
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
drrself
New User
New User
Posts: 3
Joined: Sat Mar 04, 2023 12:44 pm

Re: excel control

Post 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
PeDe
Enthusiast
Enthusiast
Posts: 278
Joined: Sun Nov 26, 2017 3:13 pm

Re: excel control

Post by PeDe »

This should work with 'GetRealProperty'.
You can find the calls in the file 'COMatePLUS_Residents.pbi'.
drrself
New User
New User
Posts: 3
Joined: Sat Mar 04, 2023 12:44 pm

Re: excel control

Post by drrself »

that did it - thanks
I have been looking at the Residents -
but.... it hasn't been all that obvious to me
Post Reply