ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   ActiveDocument object not recognized (https://www.excelbanter.com/excel-worksheet-functions/88474-activedocument-object-not-recognized.html)

LauraBorealis

ActiveDocument object not recognized
 

A beginner's question:

I am trying to insert a column into col position 2 in a table, which
apparently is to be done with the following code:

ActiveDocument.Tables(1).Columns(1).Select
Selection.InsertColumnsRight

However, when I run the macro, the object "Activedocument" is empty.
What is wrong here?
Thanks!


--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile: http://www.excelforum.com/member.php...o&userid=33789
View this thread: http://www.excelforum.com/showthread...hreadid=541836


Bob Phillips

ActiveDocument object not recognized
 
I think you want the Word groups, this is Excel.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"LauraBorealis"
wrote in message
news:LauraBorealis.27r95a_1147539002.9499@excelfor um-nospam.com...

A beginner's question:

I am trying to insert a column into col position 2 in a table, which
apparently is to be done with the following code:

ActiveDocument.Tables(1).Columns(1).Select
Selection.InsertColumnsRight

However, when I run the macro, the object "Activedocument" is empty.
What is wrong here?
Thanks!


--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile:

http://www.excelforum.com/member.php...o&userid=33789
View this thread: http://www.excelforum.com/showthread...hreadid=541836




LauraBorealis

ActiveDocument object not recognized
 

Oh, great. So the code I found isn't even for Excel, but for a table in
a Word document? I'll have to pay more attention to the environment
when code comes back from an MSDN search. (Why isn't Microsoft
consistent across platforms...)


--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile: http://www.excelforum.com/member.php...o&userid=33789
View this thread: http://www.excelforum.com/showthread...hreadid=541836


LauraBorealis

ActiveDocument object not recognized
 

To insert a column to the right of the presently selected cell:

ActiveCell.Select
ActiveCell.Offset(0, 1).Select
Selection.EntireColumn.Insert
ActiveCell.Offset(0, -1).Select


--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile: http://www.excelforum.com/member.php...o&userid=33789
View this thread: http://www.excelforum.com/showthread...hreadid=541836


Bob Phillips

ActiveDocument object not recognized
 
ActiveCell.Offset(0, 1).EntireColumn.Insert

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"LauraBorealis"
wrote in message
news:LauraBorealis.27t26y_1147623302.108@excelforu m-nospam.com...

To insert a column to the right of the presently selected cell:

ActiveCell.Select
ActiveCell.Offset(0, 1).Select
Selection.EntireColumn.Insert
ActiveCell.Offset(0, -1).Select


--
LauraBorealis
------------------------------------------------------------------------
LauraBorealis's Profile:

http://www.excelforum.com/member.php...o&userid=33789
View this thread: http://www.excelforum.com/showthread...hreadid=541836





All times are GMT +1. The time now is 12:02 AM.

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