RE: Late binding Access from Excel
- From: BeWyched <BeWyched@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Oct 2008 14:02:11 -0700
Hi Rick
Yes, I have experienced similar problems, not automating Access from Excel
but other combinations. Allthough MS don't admit it I'm of the opinion that
VBA is being left to flounder as each succusive version of office appears -
perhaps others might want to comment on this. e.g. I tried to upgrade several
different Access applications from 2003 to 2007 but had to revert back to
2003 as several important methods and processes are simply not supported
through 2007. e.g. Replication, a major feature of a couple of my
applications, is not supported under the new Access 2007 file format which I
find astonishing. I get the impression that if VBA fits as new versions are
released, that's fine, if not, then tough - VBA is gradually being erroded.
My guess is that VB will eventually become the MS Office programming language
- afterall VB is VBA's big brother, offering all VBA's functionaility so, if
I were MS, why bother supporting a 'junior' language - I might be way off the
mark here but, if I had any money left after the credit-crunch, I'd bet quite
a bit on being correct!! Sorry to get on my hobby-horse so back to your
question: I always now use late binding when automating other Office
applications. Some of my Access applications automate MS Word and this proves
a logistical nightmare if using early binding as my users may have any of the
MS Word versions on their systems. I did revert to shipping the applications
with a 'batch' of Word library files inserting the appropriate file on
installation but this proved difficult - e.g. it all works well until the
users upgrades Word at which point automation fails. MS say that late binding
causes some performace issues but I've never noticed any so, my advice would
be to go for the late binding option whenever possible.
Anyone else got any views on the above?
Cheers.
BW
"Rick" wrote:
Thanks!.
I'm working and coding in Office 2003. I've read (primarily from Microsoft)
that since I'm coding my apps in an earlier version (2003), that my early
binding should work fine for users of 2007. However, I've had problems.
That's why I'm converting my early bindings to late bindings. Have you
experienced similar problems? Why would Microsoft make such a statement?
Thanks again.
"BeWyched" wrote:
You are opening an Access container but not telling the system which Access
database to load.
Try:
...
Set acApp = GetObject(, "Access.Application")
acApp.OpenCurrentDatabase "path to database\name.mdb"
acApp.Run "DailyReport"
Good luck.
BW
"Rick" wrote:
I'm using late binding to avoid problems with different user versions of
Access 2003 and 2007. I'm automating Access from Excel, so my code is in
Excel. I removed my reference to Access in VBA Tools. My code works except
for the statement that calls the Access subroutine as below. I get a 7952
error, "Illegal function call." Help greatly appreciated.
Private Sub cmdPullData_Click()
Dim acApp As Object
Dim ws As Object
Dim dbs As Object
Dim myworkspace As String
'Access automation
Set acApp = GetObject(, "Access.Application")
Set ws = DAO.CreateWorkspace("myworkspace", "admin", "")
Set dbs = ws.OpenDatabase(strDB)
acApp.Run "DailyReport" << get 7952 error, "illegal function call"
...
End Sub
- Follow-Ups:
- Re: Late binding Access from Excel
- From: GeoffG
- RE: Late binding Access from Excel
- From: Chris O'C via AccessMonster.com
- RE: Late binding Access from Excel
- From: Chris O'C via AccessMonster.com
- RE: Late binding Access from Excel
- From: Chris O'C via AccessMonster.com
- Re: Late binding Access from Excel
- References:
- Late binding Access from Excel
- From: Rick
- RE: Late binding Access from Excel
- From: BeWyched
- RE: Late binding Access from Excel
- From: Rick
- Late binding Access from Excel
- Prev by Date: Combo box value
- Next by Date: Re: Detect a form's window mode
- Previous by thread: RE: Late binding Access from Excel
- Next by thread: RE: Late binding Access from Excel
- Index(es):
Relevant Pages
|