Excel VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shadabrab
    New Member
    • Feb 2008
    • 1

    Excel VBA

    How to activate Word document and execute word templete from Excel VBA
    Is any body can help me?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    question moved to VB forum

    Comment

    • kadghar
      Recognized Expert Top Contributor
      • Apr 2007
      • 1302

      #3
      Originally posted by shadabrab
      How to activate Word document and execute word templete from Excel VBA
      Is any body can help me?
      That question have been answered here before, but something like this will do:

      [CODE=vb]dim obj1 as object
      set obj1=createobje ct("word.applic ation")
      with obj1
      .documents.open ("c:\myDoc.doc" )
      .visible=true
      .[any word's command]
      end with[/CODE]

      Now, remember that if you have a word constant, it wont be recognized in your Excel VBA, so instead of writing the constant, write its numeric value.

      HTH

      Comment

      Working...