469,658 Members | 1,706 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,658 developers. It's quick & easy.

Access version in CreateObject

dima69
181 Expert 100+
Hi all.
I use a following code to run a procedure in another application:
Expand|Select|Wrap|Line Numbers
  1. Dim App as Access.Application
  2. set App = CreateObject("C:\MyApp.mde")
  3. App.Run "MyProc"
  4. ...
The problem is that when using CreateObject I cannot determine which version of Access will be started for App.
So if my main application supports Access2K2, and the user has Access2K installed (in addition to Access2K2), CreateObject may return Access2K application - even if calling application is running on Access2K2.

So the question is how to get the Application object of the desired Access version ?
Jul 11 '07 #1
3 2903
ADezii
8,800 Expert 8TB
Hi all.
I use a following code to run a procedure in another application:
Expand|Select|Wrap|Line Numbers
  1. Dim App as Access.Application
  2. set App = CreateObject("C:\MyApp.mde")
  3. App.Run "MyProc"
  4. ...
The problem is that when using CreateObject I cannot determine which version of Access will be started for App.
So if my main application supports Access2K2, and the user has Access2K installed (in addition to Access2K2), CreateObject may return Access2K application - even if calling application is running on Access2K2.

So the question is how to get the Application object of the desired Access version ?
  1. Your syntax for the CreateObject() Function will not work in its current context. The correct Procedure is:
    Expand|Select|Wrap|Line Numbers
    1. CreateObject(class, [servername])
    2.  
    3. Dim xlApp As Excel.Application 
    4. Set xlApp = CreateObject("Excel.Application")
  2. The specific Version is not required in the class Argument, but if you so desire, you can determine the Version by querying the Version Property of the Application Object as in:
    Expand|Select|Wrap|Line Numbers
    1. Application.Version
Jul 11 '07 #2
dima69
181 Expert 100+
  1. Your syntax for the CreateObject() Function will not work in its current context. The correct Procedure is:
    Expand|Select|Wrap|Line Numbers
    1. CreateObject(class, [servername])
    2.  
    3. Dim xlApp As Excel.Application 
    4. Set xlApp = CreateObject("Excel.Application")
  2. The specific Version is not required in the class Argument, but if you so desire, you can determine the Version by querying the Version Property of the Application Object as in:
    Expand|Select|Wrap|Line Numbers
    1. Application.Version
1. The syntax is correct. It's the alternative syntax. Moreover, It's the only one that will work in case you create Access Runtime application object (ART cannot create object without database)
2. Querying the version doesn't really help to solve the problem, if the version is not the one I need :)
Jul 11 '07 #3
ADezii
8,800 Expert 8TB
1. The syntax is correct. It's the alternative syntax. Moreover, It's the only one that will work in case you create Access Runtime application object (ART cannot create object without database)
2. Querying the version doesn't really help to solve the problem, if the version is not the one I need :)
I apologize for the misinformation - I was not aware of the alternative syntax as it relates to the Access Runtime Application Object. Thanks for the info.
Jul 11 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Jason Burr | last post: by
2 posts views Thread by Aharon Koss | last post: by
reply views Thread by dkurtz | last post: by
2 posts views Thread by auditor.software | last post: by
6 posts views Thread by Filips Benoit | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.