Hi mqueriaud,
Here's a slightly modified sample from the help files which will show
what you want.
Regards,
Laurie Comerford
{code}
Sub Example_CellManipulation()
' This example adds a table in model space and sets and gets a
column name
Dim MyModelSpace As AcadModelSpace
Set MyModelSpace = ThisDrawing.ModelSpace
Dim pt(2) As Double
Dim MyTable As AcadTable
Dim cName As String
Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)
' Call MyTable.SetCellDataType(2, 2, acLong, acUnitDistance)
' Call MyTable.SetCellFormat(1, 3, "testFormat")
Call MyTable.SetCellValue(1, 1, "Cell not locked")
Call MyTable.SetCellState(1, 1, acCellStateContentLocked)
Call MyTable.SetCellValue(1, 1, "Cell locked, so you don't see this")
MsgBox MyTable.GetCellValue(1, 1) & " is the test cell's value "
Call MyTable.SetCellState(1, 1, acCellStateNone)
Call MyTable.SetCellValue(1, 1, "Cell unlocked, so you do see this")
MsgBox MyTable.GetCellValue(1, 1) & " is the test cell's value "
ZoomExtents
End Sub
{code}
mqueriaud@ares.fr wrote:
> Hi All,
>
> Is there a way throught Acad2010 VBA to unlock a cell, or range of cells in an AcadTable?
> I can get the "IsContentEditable" property, but also would like to change the content of a locked cell.
>
> Thanks,
> Michel
>