If I place a Custom Table (General Table) on an idw, I can easily change column width in the GUI.
According to API-help Column.Width is read/write.
But if I try to set the width in iLogic I get an "unspecified error."
Dim oSheet = ActiveSheet.Sheet Dim oCustomTable = oSheet.CustomTables.Item(1) oCustomTable.Columns.Item(1).Width=3.0
What is wrong in above code?
Solved! Go to Solution.
Solved by Skadborg.NTI. Go to Solution.
Hi,
I try your code, but no error happen.
Are you already have custom table in active sheet?
Hi,
im upgrade you code with input field.
Dim oSheet = ActiveSheet.Sheet Dim oCustomTable = oSheet.CustomTables.Item(1) i = InputBox("Colomn Number?", "Colomn Input") If i = "" Then Exit Sub End If DefaultWidth = (oCustomTable.Columns.Item(Val(i)).Width) * 10 j = InputBox("Width?", "Input Width", DefaultWidth) oCustomTable.Columns.Item(Val(i)).Width = (Val(j) / 10)
Exact same error. Tried both 2017 and 2018, and on three different machines.
try This,
Dim oDwgDoc as DrawingDocument
oDwgDoc = Thisapplication.ActiveDocument
Dim oSheet as Sheet
oSheet = oDwgDoc.ActiveSheet
Dim oCustomTable as CustomTable
oCustomTable = oSheet.CustomTables.Item(1)
i = InputBox("Colomn Number?", "Colomn Input")
If i = "" Then
Exit Sub
End If
DefaultWidth = (oCustomTable.Columns.Item(Val(i)).Width) * 10
j = InputBox("Width?", "Input Width", DefaultWidth)
oCustomTable.Columns.Item(Val(i)).Width = (Val(j) / 10)
Hi,
Found the problem. It is caused by Windows Regional Settings. If I change to English(USA) it runs without problems.
it's working great, but I can't reduce the column width less the length of text(Column titel). when I use column width as 0.1. its returns as text length column width. could you please find a solution to this issue.
oCustomTable.Columns.Item(1).Width = .1
is there any possibility to kill the problem ASAP.
thanks in advance
Selvakumar v
try with comma maybe?
Hey,
Thanks for your involvement in this.
Based on your idea, I add the comma to the title Text value. but it's now working. instead on that, I have used the new line command. so I believe, it reduces the width of the columns. if you have two or more word sentence as the title I suggest using the new line to reduce the column width as below.
oTitles(0) = "BRAND" & vbCrLf & "NAME" oTitles(1) = "CATALOG NO." oTitles(2) = "PART" & vbCrLf & "DESCRIPTION"
maybe I wrong with your idea, kindly drive me in the right direction.
Looking for your solution...
Selvakumar V
Can't find what you're looking for? Ask the community or share your knowledge.