Consulting

Results 1 to 2 of 2

Thread: Word 2016 in Windows 7 and Windows 10

  1. #1

    Word 2016 in Windows 7 and Windows 10

    On one machine I have Windows 10 and on the other I have Windows 7. Both are loaded with Office 16 x86

    I've got a macro-enabled test document which, when I run it on Windows 10 it works properly. However, when I run it on the Windows 7 machine, it comes up with an error when it encounters the command to Load a userform (Load frmOfficeDetails)

    Below is the code which I have and is working on Windows 10. It is going to look for an Excel file and load the details into a combobox.

    Set CN = CreateObject("ADODB.Connection")
    
    CN.Open ConnectionString:="Provider=Microsoft.ACE.OLEDB.12.0;" & _
    "Data Source=" & inifileloc4 & ";" & _
    "Extended Properties=""Excel 12.0 Xml;HDR=YES"";"
    
    Set RS = CreateObject("ADODB.Recordset")
    RS.CursorLocation = 3
    
    RS.Open "SELECT * FROM [" & strRange, CN, 2, 1 'read the data from the worksheet
    The References I have set in the project are as follows:

    Visual Basic for Applications
    Microsoft Word 16 Object Library
    OLE Automation
    Normal
    Microsoft Office 16.0 Object Library
    Microsoft Forms 2.00 Object Library
    Microsoft ActiveX Data Objects 2.8 Library
    There's obviously something wrong here in that it won't allow me to run the document in Windows 7

    Grrrr...!

  2. #2
    I suspect the Microsoft.ACE.OLEDB.12.0 components are not installed -https://www.microsoft.com/en-us/download/details.aspx?id=13255
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •