VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unlock Cell in AcadTable

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
534 Views, 3 Replies

Unlock Cell in AcadTable

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
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

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
>
Message 3 of 4
Anonymous
in reply to: Anonymous

Many thanks Laurie,
It works fine, my eyes didn't want to see this "SetCellState" method.
Cheers. Edited by: mqueriaud@ares.fr on Nov 25, 2009 7:32 PM
Message 4 of 4
Anonymous
in reply to: Anonymous

Hi mqueriaud,

Glad to help. It was just lucky that it was a feature I hadn't used
before, so I was able to approach looking for it with the eyes of a 7
year old.

The programmer who prepared the API really didn't set it up as would be
expected.

Regards,


Laurie Comerford


mqueriaud@ares.fr wrote:
> Many thanks Laurie,
> It works fine, my eyes didn't want to see this "SetCellState" method.
> Cheers.
>
> Edited by: mqueriaud@ares.fr on Nov 25, 2009 7:32 PM
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost