ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "Select Column method or property not available because some/all of object doesn't refer to table" (https://www.excelbanter.com/excel-programming/274603-select-column-method-property-not-available-because-some-all-object-doesnt-refer-table.html)

Steven Rosenberg

"Select Column method or property not available because some/all of object doesn't refer to table"
 
I'm attempting to write a macro which pastes Excel
cells into Word, and manipulates the formating. When I
run the macro, even on the same table used to record
the macro, I get:

RunTime Error 4605 "Select Column method or
property not available because some or all of object
doesn't refer to table occurs."

asterisked line causes the error (as indicated by a
yellow arrow) :

End With
Selection.Tables(1).Select
Selection.Columns.PreferredWidthType =
wdPreferredWidthPoints
Selection.Columns.PreferredWidth =
InchesToPoints(0.92)
Selection.Move Unit:=wdColumn, Count:=1
** Selection.SelectColumn**
Selection.Collapse Direction:=wdCollapseStart
Selection.Move Unit:=wdColumn, Count:=-1
Selection.SelectColumn
Selection.Collapse Direction:=wdCollapseStart
Selection.Move Unit:=wdColumn, Count:=-1
Selection.SelectColumn
Selection.Move Unit:=wdColumn, Count:=1
Selection.SelectColumn



Any ideas?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 04:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com