Results 1 to 6 of 6

Very simple code not working

Threaded View

  1. #1
    Registered User
    Join Date
    11-10-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Very simple code not working

    Hello,
    I have a very simple code that is not working and I don't understand why because the exact same code is working for an excel document. (I guess it might be a problem with the References set up).
    Here is the code:
    Sub excelword()
         Dim modeleword As String
         modeleword = ActiveWorkbook.Path & "\tp3Modele.dotx"
         Workbooks.Add Template:=modeleword
    End Sub
    I get error '1004' file format invalid...

    Here is my the references I have set up:
    Visual basic for applications
    Microsoft Excel 12.0 Object Library
    Microsoft Word 12.0 Object Library
    OLE Automation

    Thank you very much for any help !
    Last edited by Leith Ross; 12-03-2010 at 03:28 PM. Reason: Added Code Tags

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