Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mde with variable office references? 1

Status
Not open for further replies.

khood

Programmer
Aug 27, 2000
163
US
Look for suggestions on how to handle this scenario. I am distributing a runtime package (with MDE front-end) that includes an automated mail-merge process using MS Word. Works like a charm most of the time.

One problem I have is that this is being installed at customer locations and they may have different versions of Office and/or Word and this causes the mail-merge operation to not work. It happens about 20% of the time. I have temporarily overcome this by installing their version of Word on my development PC and referencing THIS version of Word, then recreating the MDE.

Is there a way to programatically check for which version of Word they may have installed and choose the proper reference - with an MDE? Should I abandon using word altogether to avoid the hassle?

Any suggestions would be greatly appreciated!

 
How are ya khood . . . . .

Unfortunately you [blue]can't add/change/delete[/blue] Reference Libraries in an MDE. If ya use security with an MDB, I have code I can give ya . . . . . Otherwise your stuck with your present method of updating.

Calvin.gif
See Ya! . . . . . .
 
You are absolutely correct Ace!

However, if one could determine which references are required before, and deploy the correct MDE version, then I feel khood would have a good chance on success.

This is more a topic for PHV or the Cajun

khood, you may also wich to check out...
VBA Visual Basic for Applications (Microsoft) Forum

Richard
 
How are ya willir . . . . .

[blue]khood[/blue] is already doing that. Its all he/she can do!.
khood said:
[blue]I have temporarily overcome this by installing their version of Word on my development PC and referencing THIS version of Word, then recreating the MDE.[/blue]
If anyone can break into an MDE, I'd sure like to know how.

Calvin.gif
See Ya! . . . . . .
 
Another way, is to move to late binding, which is supposedly "very slow", but I think on todays computers the difference would be hardly noticable. With late binding, you wouldn't have references to the libraries you use (word...), so it would be independent of whatever office version is installed (well - to get the benefit of the "intellisence" dropdow, one would perhaps develop using early binding, and change to late binding when deplyoing).

Sample (using Excel, but it shouldn't matter much, same "type of syntax):

Early binding
[tt]dim xl as excel.application
dim wr as excel.workbook
dim sh as excel.worksheet

set xl=new excel.application
' or set xl=createobject("excel.application")
set wr=xl.workbooks.open("c:\blah.xls")
...[/tt]

Late binding (also adding the possibility of using an existing instance of excel, if exists)
[tt]dim xl as object
dim wr as object
dim sh as object

on error resume next
' looking for an existing instance of excel
set xl=getobject(,"excel.application")
if err.number<>0 then
' oups - not found
err.clear
' "creating" a new one
set xl=createobject("excel.application")
if err.number<>0 then
' oups - excel not installed?
exit sub
end if
end if
on error goto <normal errorhandler>
set wr=xl.workbooks.open("c:\blah.xls")
...[/tt]

Here's some additional info thread705-857549, thread705-676473.

Also have a look at foolio12's faq on mailmerge, using similar technique faq181-5088.

Roy-Vidar
 
I agree with Roy for late binding when the office version may vary on deployment.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I appreciate the responses from all of you.

Willir, as Ace has pointed out, I'm already creating MDEs specific for certain installs. My problem is that I'm not the installer and the user is my customer's client, so I usually don't have advance knowledge of their systems or even WHEN they plan to install it. Since most of these sites are several states away and this isn't my full-time gig, I need make it as stable and flexible as possible in advance. I don't want the guy to have to travel back to the location again because my app didn't work.

Thanks Roy, I'll give your suggestion a try sometime this week as time permits and let you know how it works out.

 
willir,

Regarding the "Microsoft Access Runtime Setup Switcher by Chris Mills" -- I have been leaning toward modifying the setup program, but decided to see if there was another way. My database has a lot of VBA code and I don't want to maintain several versions if it's not necessary.

If the suggestion by Roy doesn't work out for me, this may be the only choice I have.

Thanks.
 
ISaid said:
This is more a topic for PHV or the Cajun

After posting this, I realized I forgot about Roy. Although there are some pretty good "coders", he too rises to the top when it comes to coding. I am glad you these guys responding to your post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top