Re: Access Runtime on PC without MS Office
- From: Rick in NS <rbutler@xxxxxxxxxxxxxxxx(donotspam)>
- Date: Tue, 10 Oct 2006 11:59:01 -0700
After reading and re-reading the material on early and late binding I went
back to the 2002 copy of the application and checked the registered libraries
which were as in this order as follows:
Visual Basic for Applications
Microsoft Office 10.0 Ojbect Library
OLE Automation
Micsrosoft DAO 3.6 Object Library
Microsoft ActiveXData Objects 2.1 Libary
Microsoft Office XP Web Components
I copied the application front end and back end to the Microsoft Office 2003
which also has the Visual Studtio Microsoft Access 2003 Developer Extensions
and packaged the product including the OWC10.DLL (Web components). I ran the
install from the package wizard on the original development (Office XP)
machine.
I can run the application from Microsoft Access 2002 fully without any
difficulty.
However; when I run Microsoft Access 2003 one of the functions fails. It is
a routine that simply passes some mail merge data to a .txt file
When the routine runs is is interrupted by the following error:
"2281 The format that enable you to output data as a Miscrosft Excel,
rich-text format, MS-Dos text, or HTML file are missing or incorrectly
registered in the windows registry"
I have checked the the reference again and now find the following:
Visual Basic for Applications
Microsoft Office 11.0 Ojbect Library
Microsoft Office 10.0 Ojbect Library
OLE Automation
Micsrosoft DAO 3.6 Object Library
Microsoft ActiveXData Objects 2.1 Libary
Microsoft Office XP Web Components
I'm baffled. Any idea how I can correct the failure?
If I must 'late bind' some object can you be specific about what and how I
do that.
For example; where is the code entered; in a module or in the code
generating the text file? Excuse my ignorance but I am a bean counter
wishing I was a programmer right now.
TIA
--
Rick in NS
"Douglas J. Steele" wrote:
You don't need a reference to Excel in order to get Left to work in a query..
The Left function actually comes from the VBA library, which is usually the
first reference in the list. Unfortunately, if any of the other references
are broken, it affects functions from the VBA library, because that's
actually one of the last places Access looks for functions (this allows you
to override the built-in function with your own function with the same name
should you so desire)
Tony Toews has an introduction to Late Binding at
http://www.granite.ab.ca/access/latebinding.htm
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Rick in NS" <rbutler@xxxxxxxxxxxxxxxx(donotspam)> wrote in message
news:7359D3D4-A0A5-4E20-A880-436F5CE68A30@xxxxxxxxxxxxxxxx
--
Rick in NS
I have no idea if I have grasped the methodology at all with regard to
'late
binding' after having read everything I could find on the subject in the
MVP
site. Here is my feeble attempt to address the issue:
Dim objXL As Excel.Application
Set objXL = New Excel.Application
Sub My Sub()
Select Left(ClientName,1,7) As MySort
End Sub
objXL.Quit
Will this code address the Left function needed in the query?
"Rick Brandt" wrote:
Rick in NS wrote:
Oh boy!!! I have peppered the application with code to control
toolbars using the CommandBar object which I believe is in the
Microsoft Office Object Library 11.0 which is one of the references
in my application but not in the Access 2003 default. In addition I
have an Excel pivot table which relies on the Office XP Web Componets
(OWC10.DLL) to function properly. Removing either the reference to
the WDC10.DLL or to the Office Libary 11.0 kicks out numerous compile
errors.
I don't pretend to understand the concept of 'late binding'. Is
there a fix for this; or am I going to have to rewrite the
application removing any reference in the code to the CommandBar
object or to a OWc10.PivotTable?
Would another approach; insisting the target machine have some
version of Office on it resolve the issue?
No because "some version" would not be adequate. With early binding
(where you
set references) the exact version is required in almost all cases even
down to
having the same service packs installed.
Google these groups on "late binding". It is not very difficult to
switch your
code to use that and it really is the only way to do it when you have
multiple
machines that you cannot absolutely control what software is installed.
In
fact, most developers use early binding first to get things working
because
debugging is easier and you get to use the intellisense features in the
VBA
editor, then make the few changes to late binding afterwards when
everything is
working.
There are two huge advantages to late binding. If the user is totally
missing a
required external library, then the features in your app that depend on
that
library obviously don't work, but everything else in your app still
functions
normally. As you have seen, with early binding a missing reference
causes many
VBA functions to fail that have nothing at all to do with the missing
library.
Your app basically falls on its face.
The second big advantage is that your external library calls become (for
the
most part) version independant. In your case as long as you are not
using any
Excel features that only exist in a certain version then ANY version of
Office/Excel will likely work. With early binding you normally have to
have
the exact version for the app to function.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
- Follow-Ups:
- Re: Access Runtime on PC without MS Office
- From: paddy
- Re: Access Runtime on PC without MS Office
- References:
- Re: Access Runtime on PC without MS Office
- From: Rick Brandt
- Re: Access Runtime on PC without MS Office
- From: Rick in NS
- Re: Access Runtime on PC without MS Office
- From: Rick Brandt
- Re: Access Runtime on PC without MS Office
- From: Rick in NS
- Re: Access Runtime on PC without MS Office
- From: Douglas J. Steele
- Re: Access Runtime on PC without MS Office
- Prev by Date: Re: Access Runtime on PC without MS Office
- Next by Date: Re: Access Runtime on PC without MS Office
- Previous by thread: Re: Access Runtime on PC without MS Office
- Next by thread: Re: Access Runtime on PC without MS Office
- Index(es):
Relevant Pages
|
Loading