Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Accessing different versions of Excel VBA from another application

I often run Excel VBA applications from AutoCAD, but the reference to Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application fails.
Is there a way to check for Excel versions and apply the correct application
reference?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Accessing different versions of Excel VBA from another application

Hi Bradley,
msgbox "Excel Version = " & Application.Version
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Bradley Dawson" wrote in message ...
I often run Excel VBA applications from AutoCAD, but the reference to Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application fails.
Is there a way to check for Excel versions and apply the correct application
reference?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Accessing different versions of Excel VBA from another application

Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the reference to

Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application fails.
Is there a way to check for Excel versions and apply the correct

application
reference?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Accessing different versions of Excel VBA from another application

Late binding WILL cause a perforance hit.....depending on your particular
application, this may or may not be acceptable. I would early bind and
reference an earlier version of Excel (like 97 or 2000, assuming you don't
use any features not supported by these apps). If the user has a new
version of Excel you will be fine.

Bill Barclift


"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the reference to

Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application

fails.
Is there a way to check for Excel versions and apply the correct

application
reference?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Accessing different versions of Excel VBA from another application

I like that, but the office computer is up to date and only references the
latest version, user's home computer's usually have older versions. Also,
once the program is run on a newer version, that seems to become the
reference and won't run on older versions.
Since I'm a newbie, I'll have to read up on this "binding" that I have
skipped over so much. Thanks for the help.

"Bill Barclift" wrote in message
...
Late binding WILL cause a perforance hit.....depending on your particular
application, this may or may not be acceptable. I would early bind and
reference an earlier version of Excel (like 97 or 2000, assuming you don't
use any features not supported by these apps). If the user has a new
version of Excel you will be fine.

Bill Barclift


"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever

Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the reference to

Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application

fails.
Is there a way to check for Excel versions and apply the correct

application
reference?










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Accessing different versions of Excel VBA from another application

Thanks Tom, these links will be my reading assignment! (Always wondered
what that binding thing was)
"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the reference to

Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application

fails.
Is there a way to check for Excel versions and apply the correct

application
reference?






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Accessing different versions of Excel VBA from another application

Thanks, David. I have your site in my favorites under programming. I
should have looked there first.

"David McRitchie" wrote in message
...
Hi Bradley,
msgbox "Excel Version = " & Application.Version
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Bradley Dawson" wrote in message

...
I often run Excel VBA applications from AutoCAD, but the reference to

Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application

fails.
Is there a way to check for Excel versions and apply the correct

application
reference?






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Accessing different versions of Excel VBA from another application

I would still approach it this way. Get a copy of someones older Excel type
library file called Excel8.olb or Excel9.olb. Put it on your computer (you
don't need to do anything with it, just get a copy of it) and reference it
before you save the Autocad file. This should work fine for your users. (I
haven't tried this in VBA but have done it many times in VB....I think it
should work fine in VBA, as well)

Bill Barclift


"Bradley Dawson" wrote in message
...
I like that, but the office computer is up to date and only references the
latest version, user's home computer's usually have older versions. Also,
once the program is run on a newer version, that seems to become the
reference and won't run on older versions.
Since I'm a newbie, I'll have to read up on this "binding" that I have
skipped over so much. Thanks for the help.

"Bill Barclift" wrote in message
...
Late binding WILL cause a perforance hit.....depending on your

particular
application, this may or may not be acceptable. I would early bind and
reference an earlier version of Excel (like 97 or 2000, assuming you

don't
use any features not supported by these apps). If the user has a new
version of Excel you will be fine.

Bill Barclift


"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever

Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the reference

to
Excel
is particular to the company's computer that I use. When it is run

on
another computer with a different version of Excel, the application

fails.
Is there a way to check for Excel versions and apply the correct
application
reference?










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Accessing different versions of Excel VBA from another application

I don't believe the performance hit will be significant.

Microsoft is making the recommendation.


--
Regards,
Tom Ogilvy


Bill Barclift wrote in message
...
Late binding WILL cause a perforance hit.....depending on your particular
application, this may or may not be acceptable. I would early bind and
reference an earlier version of Excel (like 97 or 2000, assuming you don't
use any features not supported by these apps). If the user has a new
version of Excel you will be fine.

Bill Barclift


"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever

Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the reference to

Excel
is particular to the company's computer that I use. When it is run on
another computer with a different version of Excel, the application

fails.
Is there a way to check for Excel versions and apply the correct

application
reference?








  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Accessing different versions of Excel VBA from another application

The user doesn't save the file with updated references in VB as Bradley
describes.

--
Regards,
Tom Ogilvy

Bill Barclift wrote in message
...
I would still approach it this way. Get a copy of someones older Excel

type
library file called Excel8.olb or Excel9.olb. Put it on your computer

(you
don't need to do anything with it, just get a copy of it) and reference it
before you save the Autocad file. This should work fine for your users.

(I
haven't tried this in VBA but have done it many times in VB....I think it
should work fine in VBA, as well)

Bill Barclift


"Bradley Dawson" wrote in message
...
I like that, but the office computer is up to date and only references

the
latest version, user's home computer's usually have older versions.

Also,
once the program is run on a newer version, that seems to become the
reference and won't run on older versions.
Since I'm a newbie, I'll have to read up on this "binding" that I have
skipped over so much. Thanks for the help.

"Bill Barclift" wrote in message
...
Late binding WILL cause a perforance hit.....depending on your

particular
application, this may or may not be acceptable. I would early bind

and
reference an earlier version of Excel (like 97 or 2000, assuming you

don't
use any features not supported by these apps). If the user has a new
version of Excel you will be fine.

Bill Barclift


"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever

Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the reference

to
Excel
is particular to the company's computer that I use. When it is

run
on
another computer with a different version of Excel, the

application
fails.
Is there a way to check for Excel versions and apply the correct
application
reference?














  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Accessing different versions of Excel VBA from another application

Sorry, apparently I did not communicate well.

The developer should get a copy of Excel8.olb or Excel9.olb and save it on
his/her computer. Then reference this in the Autocad macro file just before
saving, instead of their version of the Excel library. Redistribute this
copy to the user. Com will re-route the reference to the users version of
the Excel library just fine, as long the version of Excel is not older than
the version the developer referenced when the file was saved.

I tried this with AutoCAD 2002 and it worked just fine, just as it does in
VB6.

Bill Barclift

"Tom Ogilvy" wrote in message
...
The user doesn't save the file with updated references in VB as Bradley
describes.

--
Regards,
Tom Ogilvy

Bill Barclift wrote in message
...
I would still approach it this way. Get a copy of someones older Excel

type
library file called Excel8.olb or Excel9.olb. Put it on your computer

(you
don't need to do anything with it, just get a copy of it) and reference

it
before you save the Autocad file. This should work fine for your users.

(I
haven't tried this in VBA but have done it many times in VB....I think

it
should work fine in VBA, as well)

Bill Barclift


"Bradley Dawson" wrote in message
...
I like that, but the office computer is up to date and only references

the
latest version, user's home computer's usually have older versions.

Also,
once the program is run on a newer version, that seems to become the
reference and won't run on older versions.
Since I'm a newbie, I'll have to read up on this "binding" that I have
skipped over so much. Thanks for the help.

"Bill Barclift" wrote in message
...
Late binding WILL cause a perforance hit.....depending on your

particular
application, this may or may not be acceptable. I would early bind

and
reference an earlier version of Excel (like 97 or 2000, assuming you

don't
use any features not supported by these apps). If the user has a

new
version of Excel you will be fine.

Bill Barclift


"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever
Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the

reference
to
Excel
is particular to the company's computer that I use. When it is

run
on
another computer with a different version of Excel, the

application
fails.
Is there a way to check for Excel versions and apply the correct
application
reference?














  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Accessing different versions of Excel VBA from another application

You communicated fine.
Apparently you didn't read what Bradley said very well.

The user opens the file in xl2002 at work and saves the file. The
references were then updated to xl2002 references. The user takes the file
home to work on excel 97, the file now doesn't work. Unlike a VB file.

--
Regards,
Tom Ogilvy

Bill Barclift wrote in message
...
Sorry, apparently I did not communicate well.

The developer should get a copy of Excel8.olb or Excel9.olb and save it on
his/her computer. Then reference this in the Autocad macro file just

before
saving, instead of their version of the Excel library. Redistribute this
copy to the user. Com will re-route the reference to the users version of
the Excel library just fine, as long the version of Excel is not older

than
the version the developer referenced when the file was saved.

I tried this with AutoCAD 2002 and it worked just fine, just as it does in
VB6.

Bill Barclift

"Tom Ogilvy" wrote in message
...
The user doesn't save the file with updated references in VB as Bradley
describes.

--
Regards,
Tom Ogilvy

Bill Barclift wrote in message
...
I would still approach it this way. Get a copy of someones older

Excel
type
library file called Excel8.olb or Excel9.olb. Put it on your computer

(you
don't need to do anything with it, just get a copy of it) and

reference
it
before you save the Autocad file. This should work fine for your

users.
(I
haven't tried this in VBA but have done it many times in VB....I think

it
should work fine in VBA, as well)

Bill Barclift


"Bradley Dawson" wrote in message
...
I like that, but the office computer is up to date and only

references
the
latest version, user's home computer's usually have older versions.

Also,
once the program is run on a newer version, that seems to become the
reference and won't run on older versions.
Since I'm a newbie, I'll have to read up on this "binding" that I

have
skipped over so much. Thanks for the help.

"Bill Barclift" wrote in message
...
Late binding WILL cause a perforance hit.....depending on your
particular
application, this may or may not be acceptable. I would early

bind
and
reference an earlier version of Excel (like 97 or 2000, assuming

you
don't
use any features not supported by these apps). If the user has a

new
version of Excel you will be fine.

Bill Barclift


"Tom Ogilvy" wrote in message
...
Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications

Whenever
Possible


--
Regards,
Tom Ogilvy


Bradley Dawson wrote in message
...
I often run Excel VBA applications from AutoCAD, but the

reference
to
Excel
is particular to the company's computer that I use. When it

is
run
on
another computer with a different version of Excel, the

application
fails.
Is there a way to check for Excel versions and apply the

correct
application
reference?
















Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please include fonts from previous versions ('98) in new versions JJBQ Excel Discussion (Misc queries) 3 October 8th 05 07:19 PM
Accessing Excel pages using VB bob_mhc Excel Discussion (Misc queries) 1 July 16th 05 10:28 PM
Accessing WorksheetFunction.XX from regular C# Forms application Jes Ramsing Excel Worksheet Functions 1 June 16th 05 12:21 PM
Accessing Outlook from Excel Chaplain Doug Excel Discussion (Misc queries) 0 December 19th 04 11:39 PM
Excel.Application Instantiating Different Versions Tom Antola Excel Programming 0 September 10th 03 06:07 PM


All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"