Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LauraBorealis
 
Posts: n/a
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LauraBorealis
 
Posts: n/a
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LauraBorealis
 
Posts: n/a
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannor strech embedded word object BartDesc Excel Discussion (Misc queries) 2 March 10th 06 08:15 AM
Object Frank Xia Setting up and Configuration of Excel 0 March 3rd 06 12:08 AM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
Creating a Powerpoint object (in XP onwards) with an ActiveWindow BizMark Excel Discussion (Misc queries) 0 August 12th 05 12:46 PM
VBA: Where to find Excel Object model? N. Foldager Excel Discussion (Misc queries) 13 February 6th 05 06:43 PM


All times are GMT +1. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"