+ Reply to Thread
Results 1 to 8 of 8

Word Vba run from Excel

  1. #1
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    Word Vba run from Excel

    Hi Experts,


    I have a excel macro that is activating my word macro.

    in the excel macro when I have
    Please Login or Register  to view this content.
    everything works however
    when i set
    Please Login or Register  to view this content.
    the below codes do not work. Please advise as to what i am doing wrong since I would prefer to use
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word Vba run from Excel

    Why are you working with a Selection, instead of Range objects? What, exactly, are you trying to delete?
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    Re: Word Vba run from Excel

    Hi acropop,

    Below is the word vba and also a sample file, hope this helps to explain what i am doing.

    Please Login or Register  to view this content.

    test file.docx

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word Vba run from Excel

    Try the following:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    Re: Word Vba run from Excel

    Hi macropod,

    your code works perfectly however i need to add the below condition.
    I know that the below does not currently work, just wanted to better explan.


    If find condition is true then delete the find line and also the 2 first instances of Text = Chr(12)
    else just delete the first instance of Text = Chr(12)

    I hope this makes sense.


    Please Login or Register  to view this content.

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word Vba run from Excel

    You should be able to achieve what you want by changing:
    Please Login or Register  to view this content.
    in the code I posted to:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    Re: Word Vba run from Excel

    Hi Macropod,

    Your suggestion worked perfectly.

    Can you please explain in detail how the below codes work or point me to the resource to read. The characters and symbols are throwing me off.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word Vba run from Excel


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Extracting data from excel to word. Different versions of MS Word giving issues.
    By aritradey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 09:46 AM
  2. [SOLVED] Excel macro- Find replace an itallic font word with a regular word?
    By thisisaboutwork in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2013, 01:48 PM
  3. Need help with Excel-to-Word find and replace macro based on word filename
    By EnterTheSerpent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2013, 12:48 PM
  4. [SOLVED] How to read Excel or Word file (Multi-Word phrases) into Array
    By pradeepdeepu_001 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-15-2013, 03:02 AM
  5. Excel to Word passing data dynamically with bookmarks from Excel to Word
    By csekhar.apps in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2010, 09:52 AM
  6. Import cells from excel into word and create multiple word docs
    By scdaddy7269 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2006, 03:03 PM
  7. Replies: 1
    Last Post: 02-18-2005, 11:06 AM

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