04-17-2019 01:47 PM
Hello all:
I'm having an issue with my XTables. I want my data to be center aligned within each cell, but "cell.Alignment=1" keeps returning the following error: "Object doesn't support this property or method: 'Cell.Alignment'."
The interesting thing is, however, that the header row for the columns (row 0) center aligns properly, without throwing an error. Everything besides that remains left aligned.
I've attached a screenshot of my code. Any assistance would be greatly appreciated!!!
Thanks,
Alex
04-17-2019 02:00 PM
Cell.VerticalAlignment = 1
04-17-2019 02:05 PM
gskylr:
Thanks for the response. Looks like that would work for vertical alignment, but I'm looking to center the text horizontally within the cell.
Any thoughts?
Thanks,
Alex
04-17-2019 03:00 PM
Is any of your columns not of "Text" type? they could be ListBox or something else which does not support "Alignment" property?
04-18-2019 10:40 AM
gsklyr:
No, they are all "Text" types- I'm putting values from channel properties as well as data from data channels into the cells.
I'm still stumped on this...
Thanks,
Alex
04-18-2019 12:42 PM
The return value of the function Val() is of numeric type and you are assigning it ti a cell.text. Could it be messing with things? Maybe you need to convert it back to string
04-23-2019 06:35 AM
Unfortunately, that is still throwing the same error. Any more thoughts?
04-23-2019 10:53 AM
At the top of your EventValGet put the line:
Call MsgBox(Cell.Alignment)
You will be able to see the order of execution and understand when exactly it fails
04-25-2019 07:02 AM
The issue appears to start right after inserting the column headers.
I have the following error: "Object doesnt support this property or method: 'Cell Alignment'."
It throws that error in the msgbox line that you suggested.
Thanks,
04-25-2019 11:45 AM
Maybe it can't align something that is not populated? looks like this function runs at initialization, how about using Alignment property only when cells have been initialized/populated?