+ Reply to Thread
Results 1 to 5 of 5

ActiveDocument object not recognized

  1. #1
    Registered User
    Join Date
    04-24-2006
    Posts
    3

    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?
    (Excell 2003 running under Windows XP)

    Thanks!
    Last edited by LauraBorealis; 05-13-2006 at 12:51 PM.

  2. #2
    Bob Phillips
    Guest

    Re: 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" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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. #3
    Registered User
    Join Date
    04-24-2006
    Posts
    3

    So what is the Excel equivalent of the above code?

    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...)

  4. #4
    Registered User
    Join Date
    04-24-2006
    Posts
    3

    Found it - inserting a column

    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

  5. #5
    Bob Phillips
    Guest

    Re: ActiveDocument object not recognized

    ActiveCell.Offset(0, 1).EntireColumn.Insert

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "LauraBorealis" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1