Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Go Back  Xtreme Visual Basic Talk > > > > Excel VBA Word Automation Not Working with Office 2013


Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2017, 07:52 AM
MillExcel VBA Word Automation Not Working with Office 2013 Mill is offline
Ultimate Contributor

Retired Moderator
* Guru *
 
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,636
Default Excel VBA Word Automation Not Working with Office 2013


In my company, we generally have Office 2007.

I have a program that creates a Sales Letter in MS Word. The file already exists with formatting set up, but I've created Bookmarks in the Word document that I can then replace with text according to the Excel file. In other words, each key element in the Word document (e.g. Customer Name) has a book mark with dummy text that gets overwritten with a value from the Excel file.

This works great in 2007. However, we now have some users who are on Office 2013 and the same code no longer works.

Code:
    
    Dim myWd As Object

    myWd.Documents.Open strDocPath, , True  'strDocPath is the path to the file
    
    With myWd
        .Documents(strDocPath).Bookmarks("Date").Select
        .Selection.TypeText strDate  'This works in 2007, but not in 2013
        
        Set wdRange = .Documents(strDocPath).Bookmarks("Customer").Range
        wdRange.Text = strCustomer   'Again, this doesn't work in 2013        
    End With
Has anyone encountered this before? I don't know if I need to modify my Word document or my VBA code.
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
Reply With Quote
  #2  
Old 02-17-2017, 07:25 PM
Kluz's Avatar
KluzExcel VBA Word Automation Not Working with Office 2013 Kluz is offline
Sapience.Aquire

Super Moderator
* Expert *
 
Join Date: Oct 2003
Location: Lake Bluff, Ill., U.S.
Posts: 3,436
Default

Can you manually GoTo (as in Go To dialog) these bookmarks? Can you edit them manually? What happens if you recreate them in the document?
Also check here.
__________________
No the other right mouse click
Reply With Quote
Reply

Tags
word, file, office, document, excel, set, code, mywd, strdocpath, text, vba, modify, mywd.documents.open, object, dim, true, strcustomer, wdrange.text, users, encountered, path, .selection.typetext, wdrange, strdate, book


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013 Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
 
Excel VBA Word Automation Not Working with Office 2013
Excel VBA Word Automation Not Working with Office 2013
 
-->