There is a program that displays a tabular report in Word. The program is in Delphi, the work is done through OleVariant, but this is not the point, the problem remains with the use of pure VBA.
The essence of the problem: when trying to access the column, the error "There is no access to individual columns because the table cells have different widths" is displayed
Sub Макрос2() ActiveDocument.Range.Text = "" '' //если следующие 2 строчки закомментировать - ошибка выходит далеко не всегда '' //как это связано - не знаю, но в коде Delphi этих строк нет, '' //а там ошибка появляется гарантированно. '' // оставляем как есть - ошибка проявляется всегда. Application.ActiveWindow.View.Type = wdNormalView Application.ActiveWindow.View.Type = wdWebView ActiveDocument.Range.Text = _ vbTab & "asdf asdf" & vbTab & vbTab & vbTab & "asdf asdf" & vbCrLf _ & vbTab & "asdf asdf" & vbTab & vbTab & vbTab & "asdf asdf" & vbCrLf _ & vbTab & "asdf asdf" & vbTab & vbTab & vbTab & "asdf asdf" & vbCrLf _ & vbTab & "asdf asdf" & vbTab & vbTab & vbTab & "asdf asdf" & vbCrLf _ ActiveDocument.Range.ConvertToTable (vbTab) '' //ошибка здесь, при доступе к Item(1) ActiveDocument.Tables(1).Columns.Item(1).Width = 11 ''// ActiveDocument.Tables(1).Columns(1).Width = 11 тоже не работает End Sub I looked through other questions about this error - they write everywhere that it is associated with the union of cells. However, in this code there is no union and the number of columns in the rows is identical!
Is it possible (and how) to get around this?
Columns.Item(1)withColumns(1)- Edward Izmalkov