PDA

View Full Version : Word 2016 in Windows 7 and Windows 10



Roderick
10-23-2017, 08:09 AM
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...!

gmayor
10-23-2017, 10:15 PM
I suspect the Microsoft.ACE.OLEDB.12.0 components are not installed -https://www.microsoft.com/en-us/download/details.aspx?id=13255