+ Reply to Thread
Results 1 to 3 of 3

using vba to print a linked word document from the spread sheet

  1. #1
    Registered User
    Join Date
    04-05-2013
    Location
    la Crosse wi
    MS-Off Ver
    Excel 2010
    Posts
    3

    using vba to print a linked word document from the spread sheet

    I have a word document linked to a worksheet via the 'special paste' option. I want my user to be able to print this word document from a button on the work sheet. The following code:
    Sub PrintFromLinkedWordDoc()
    Dim objWord As Object
    Dim objDoc As Object
    Set objWord = CreateObject("Word.Application")
    objWord.Visible = False
    Set objDoc = objWord.Documents.Open _
    ("C:\Users\my name\Documents\Excel Test Spread Sheats\Printing word from exce\Target.docx")
    objDoc.PrintOut
    objDoc.Close
    objWord.Quit
    End Sub
    results in Run-Time error '5174' "This file cannot be found". I am sure the pathway is correct. I must be missing a setting or something. Any help would be greatly appreciated
    thank you, OldFart1

  2. #2
    Registered User
    Join Date
    04-05-2013
    Location
    la Crosse wi
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: using vba to print a linked word document from the spread sheet

    the above macro works fine if the file "Target" is placed in the "Documents" folder and not in any of its sub folders. OldFart1

  3. #3
    Registered User
    Join Date
    04-05-2013
    Location
    la Crosse wi
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: using vba to print a linked word document from the spread sheet

    Does anyone know how to make this work for files in sub-folders in the "My Documents" folder?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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