Late Binding Question

Zedster

Registered User.
Local time
Today, 19:11
Joined
Jul 2, 2019
Messages
169
Many of my Access databases create Excel Workbooks and powerpoint presentations for reports. Currently I use early binding. I have just been upgraded to Office 2016 but others in my company are running 2013.

I am keen to convert my early binding to late binding. Do I just need to do this for all my non Access objects (Excel & Powerpoint) or do i need to late bind access objects too?
 
you should not need to late bind access objects, however if one user is using 64bit access/office and another 32bit and you are using API's the API calls will need to be changed
 
Not using APIs most if not all of my database objects are DAO databases, recordsets and querydefs.
 
Not using APIs most if not all of my database objects are DAO databases, recordsets and querydefs.

Hi. Then, you just need to late bind the objects you automate, eg. Excel and PP.
 
Quick question on late binding, not done it before is this right:
Code:
Dim xl as object
Dim wbk as object
Dim wsht as object
 
10170                Set xl = New Excel.Application
10180                xl.DisplayAlerts = False
10190                Set wbk = xl.Workbooks.Open(strTemplatePath & "\" & strTemplateFilename)
10200                Set wsht = wbk.Worksheets("Form")
 
no

Set xl = createobject("Excel.Application")

not apparent from your code but if you are using excel variables such as xlSortOrder (pretty much anything that starts with 'xl') then you need to declare them as constants with the appropriate value (xlSortOrder is 1 for example). You can just substitute with the value, but the code will be clearer if you use a constant
 
you leave it as-is.
 
they should be the same since workbooks and worksheets are part of the xl object
 

Users who are viewing this thread

Back
Top Bottom