PC Review


Reply
Thread Tools Rate Thread

Difference office versions

 
 
oldjay
Guest
Posts: n/a
 
      7th Oct 2009
I am trying to test for various versions of office.
The following doesn't work.
Need help


Private Sub CommandButton39_Click() 'Add new customer
Dim X As String
Dim Y As String
Dim Z As String

On Error GoTo ehandler3

X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
\\SERVER3\database\customers.MDB", 1)
Exit Sub

ehandler3:
On Error GoTo ehandler4

Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
\\SERVER3\database\customers.MDB", 1)
Exit Sub

ehandler4:

Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
\\SERVER3\database\customers.MDB", 1)

End Sub
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      7th Oct 2009
Hi,

Try this

ThisVersion = Application.Version

Mike

"oldjay" wrote:

> I am trying to test for various versions of office.
> The following doesn't work.
> Need help
>
>
> Private Sub CommandButton39_Click() 'Add new customer
> Dim X As String
> Dim Y As String
> Dim Z As String
>
> On Error GoTo ehandler3
>
> X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
> \\SERVER3\database\customers.MDB", 1)
> Exit Sub
>
> ehandler3:
> On Error GoTo ehandler4
>
> Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
> \\SERVER3\database\customers.MDB", 1)
> Exit Sub
>
> ehandler4:
>
> Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
> \\SERVER3\database\customers.MDB", 1)
>
> End Sub

 
Reply With Quote
 
oldjay
Guest
Posts: n/a
 
      7th Oct 2009
I inserted "ThisVersion = Application.Version" as the first line of the Sub.

Same result

"Mike H" wrote:

> Hi,
>
> Try this
>
> ThisVersion = Application.Version
>
> Mike
>
> "oldjay" wrote:
>
> > I am trying to test for various versions of office.
> > The following doesn't work.
> > Need help
> >
> >
> > Private Sub CommandButton39_Click() 'Add new customer
> > Dim X As String
> > Dim Y As String
> > Dim Z As String
> >
> > On Error GoTo ehandler3
> >
> > X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
> > \\SERVER3\database\customers.MDB", 1)
> > Exit Sub
> >
> > ehandler3:
> > On Error GoTo ehandler4
> >
> > Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
> > \\SERVER3\database\customers.MDB", 1)
> > Exit Sub
> >
> > ehandler4:
> >
> > Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
> > \\SERVER3\database\customers.MDB", 1)
> >
> > End Sub

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      7th Oct 2009
Hi,

I don't understand whay you mean by 'Same result'

try it in an empty sub with no other code

Sub version()
MsgBox Application.version
End Sub

Mike

"oldjay" wrote:

> I inserted "ThisVersion = Application.Version" as the first line of the Sub.
>
> Same result
>
> "Mike H" wrote:
>
> > Hi,
> >
> > Try this
> >
> > ThisVersion = Application.Version
> >
> > Mike
> >
> > "oldjay" wrote:
> >
> > > I am trying to test for various versions of office.
> > > The following doesn't work.
> > > Need help
> > >
> > >
> > > Private Sub CommandButton39_Click() 'Add new customer
> > > Dim X As String
> > > Dim Y As String
> > > Dim Z As String
> > >
> > > On Error GoTo ehandler3
> > >
> > > X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
> > > \\SERVER3\database\customers.MDB", 1)
> > > Exit Sub
> > >
> > > ehandler3:
> > > On Error GoTo ehandler4
> > >
> > > Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
> > > \\SERVER3\database\customers.MDB", 1)
> > > Exit Sub
> > >
> > > ehandler4:
> > >
> > > Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
> > > \\SERVER3\database\customers.MDB", 1)
> > >
> > > End Sub

 
Reply With Quote
 
oldjay
Guest
Posts: n/a
 
      7th Oct 2009
This spreadsheet is used by different people using different versions of
Office. The purpose is to detect which version they are using and open the
proper Access database. It works for 2 version of Office but not 3.
I am wondering if you can have an On Error Goto ehandler3 under another On
Error Goto ehandler2??

"Mike H" wrote:

> Hi,
>
> I don't understand whay you mean by 'Same result'
>
> try it in an empty sub with no other code
>
> Sub version()
> MsgBox Application.version
> End Sub
>
> Mike
>
> "oldjay" wrote:
>
> > I inserted "ThisVersion = Application.Version" as the first line of the Sub.
> >
> > Same result
> >
> > "Mike H" wrote:
> >
> > > Hi,
> > >
> > > Try this
> > >
> > > ThisVersion = Application.Version
> > >
> > > Mike
> > >
> > > "oldjay" wrote:
> > >
> > > > I am trying to test for various versions of office.
> > > > The following doesn't work.
> > > > Need help
> > > >
> > > >
> > > > Private Sub CommandButton39_Click() 'Add new customer
> > > > Dim X As String
> > > > Dim Y As String
> > > > Dim Z As String
> > > >
> > > > On Error GoTo ehandler3
> > > >
> > > > X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
> > > > \\SERVER3\database\customers.MDB", 1)
> > > > Exit Sub
> > > >
> > > > ehandler3:
> > > > On Error GoTo ehandler4
> > > >
> > > > Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
> > > > \\SERVER3\database\customers.MDB", 1)
> > > > Exit Sub
> > > >
> > > > ehandler4:
> > > >
> > > > Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
> > > > \\SERVER3\database\customers.MDB", 1)
> > > >
> > > > End Sub

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      8th Oct 2009
Public gXLver As Long

Sub test()
gXLver = Val(Application.Version) ' in startup routine

If gXLver >= 10 Then
' XL 2002, 2003, 2007
' (2010 will be 14)
Else
' XL 97 Or 2000
End If

End Sub

Depending on what you are doing you can't necessarily put XL2002+ methods in
the same routine or even module. Even if the code doesn't get called in the
earlier version a compile error can occur if the object or arguments in a
built in function are nor recognized.

Regards,
Peter T


"oldjay" <(E-Mail Removed)> wrote in message
news:7702FF4B-60D7-4DE8-878D-(E-Mail Removed)...
> This spreadsheet is used by different people using different versions of
> Office. The purpose is to detect which version they are using and open the
> proper Access database. It works for 2 version of Office but not 3.
> I am wondering if you can have an On Error Goto ehandler3 under another On
> Error Goto ehandler2??
>
> "Mike H" wrote:
>
>> Hi,
>>
>> I don't understand whay you mean by 'Same result'
>>
>> try it in an empty sub with no other code
>>
>> Sub version()
>> MsgBox Application.version
>> End Sub
>>
>> Mike
>>
>> "oldjay" wrote:
>>
>> > I inserted "ThisVersion = Application.Version" as the first line of the
>> > Sub.
>> >
>> > Same result
>> >
>> > "Mike H" wrote:
>> >
>> > > Hi,
>> > >
>> > > Try this
>> > >
>> > > ThisVersion = Application.Version
>> > >
>> > > Mike
>> > >
>> > > "oldjay" wrote:
>> > >
>> > > > I am trying to test for various versions of office.
>> > > > The following doesn't work.
>> > > > Need help
>> > > >
>> > > >
>> > > > Private Sub CommandButton39_Click() 'Add new customer
>> > > > Dim X As String
>> > > > Dim Y As String
>> > > > Dim Z As String
>> > > >
>> > > > On Error GoTo ehandler3
>> > > >
>> > > > X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
>> > > > \\SERVER3\database\customers.MDB", 1)
>> > > > Exit Sub
>> > > >
>> > > > ehandler3:
>> > > > On Error GoTo ehandler4
>> > > >
>> > > > Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
>> > > > \\SERVER3\database\customers.MDB", 1)
>> > > > Exit Sub
>> > > >
>> > > > ehandler4:
>> > > >
>> > > > Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
>> > > > \\SERVER3\database\customers.MDB", 1)
>> > > >
>> > > > End Sub



 
Reply With Quote
 
oldjay
Guest
Posts: n/a
 
      8th Oct 2009
I guess I don't explain my self very well. If you look at the Sub you will
see that I am trying to open an access database, I first must know what
Version of Office the user has. Then I must open that version and then open
the customer database on a server. My problem is I can test for 2 versions of
Office but not 3

"Peter T" wrote:

> Public gXLver As Long
>
> Sub test()
> gXLver = Val(Application.Version) ' in startup routine
>
> If gXLver >= 10 Then
> ' XL 2002, 2003, 2007
> ' (2010 will be 14)
> Else
> ' XL 97 Or 2000
> End If
>
> End Sub
>
> Depending on what you are doing you can't necessarily put XL2002+ methods in
> the same routine or even module. Even if the code doesn't get called in the
> earlier version a compile error can occur if the object or arguments in a
> built in function are nor recognized.
>
> Regards,
> Peter T
>
>
> "oldjay" <(E-Mail Removed)> wrote in message
> news:7702FF4B-60D7-4DE8-878D-(E-Mail Removed)...
> > This spreadsheet is used by different people using different versions of
> > Office. The purpose is to detect which version they are using and open the
> > proper Access database. It works for 2 version of Office but not 3.
> > I am wondering if you can have an On Error Goto ehandler3 under another On
> > Error Goto ehandler2??
> >
> > "Mike H" wrote:
> >
> >> Hi,
> >>
> >> I don't understand whay you mean by 'Same result'
> >>
> >> try it in an empty sub with no other code
> >>
> >> Sub version()
> >> MsgBox Application.version
> >> End Sub
> >>
> >> Mike
> >>
> >> "oldjay" wrote:
> >>
> >> > I inserted "ThisVersion = Application.Version" as the first line of the
> >> > Sub.
> >> >
> >> > Same result
> >> >
> >> > "Mike H" wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > Try this
> >> > >
> >> > > ThisVersion = Application.Version
> >> > >
> >> > > Mike
> >> > >
> >> > > "oldjay" wrote:
> >> > >
> >> > > > I am trying to test for various versions of office.
> >> > > > The following doesn't work.
> >> > > > Need help
> >> > > >
> >> > > >
> >> > > > Private Sub CommandButton39_Click() 'Add new customer
> >> > > > Dim X As String
> >> > > > Dim Y As String
> >> > > > Dim Z As String
> >> > > >
> >> > > > On Error GoTo ehandler3
> >> > > >
> >> > > > X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
> >> > > > \\SERVER3\database\customers.MDB", 1)
> >> > > > Exit Sub
> >> > > >
> >> > > > ehandler3:
> >> > > > On Error GoTo ehandler4
> >> > > >
> >> > > > Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
> >> > > > \\SERVER3\database\customers.MDB", 1)
> >> > > > Exit Sub
> >> > > >
> >> > > > ehandler4:
> >> > > >
> >> > > > Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
> >> > > > \\SERVER3\database\customers.MDB", 1)
> >> > > >
> >> > > > End Sub

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      9th Oct 2009
I don't understand the problem, you can test and respond for all versions.

*warning air-code*

Dim nVer as long
Dim sFile as string

nVer = Val(Application.Version)

Select Case nVer
Case 10 : sFile = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
\\SERVER3\database\customers.MD" ' mdb ?
Case 11 : sFile = "< the 2003 version>"
Case 12: sFile = "< the 2007 cersion>"
End select

If Len(sFile) then
result = Shell(sFile,1)
else
msgbox "File doesn't exist for use in Office 97 or 2000"
End If

Regards,
Peter T

"oldjay" <(E-Mail Removed)> wrote in message
news:4FCDE10E-9883-4E4A-8810-(E-Mail Removed)...
>I guess I don't explain my self very well. If you look at the Sub you will
> see that I am trying to open an access database, I first must know what
> Version of Office the user has. Then I must open that version and then
> open
> the customer database on a server. My problem is I can test for 2 versions
> of
> Office but not 3
>
> "Peter T" wrote:
>
>> Public gXLver As Long
>>
>> Sub test()
>> gXLver = Val(Application.Version) ' in startup routine
>>
>> If gXLver >= 10 Then
>> ' XL 2002, 2003, 2007
>> ' (2010 will be 14)
>> Else
>> ' XL 97 Or 2000
>> End If
>>
>> End Sub
>>
>> Depending on what you are doing you can't necessarily put XL2002+ methods
>> in
>> the same routine or even module. Even if the code doesn't get called in
>> the
>> earlier version a compile error can occur if the object or arguments in a
>> built in function are nor recognized.
>>
>> Regards,
>> Peter T
>>
>>
>> "oldjay" <(E-Mail Removed)> wrote in message
>> news:7702FF4B-60D7-4DE8-878D-(E-Mail Removed)...
>> > This spreadsheet is used by different people using different versions
>> > of
>> > Office. The purpose is to detect which version they are using and open
>> > the
>> > proper Access database. It works for 2 version of Office but not 3.
>> > I am wondering if you can have an On Error Goto ehandler3 under another
>> > On
>> > Error Goto ehandler2??
>> >
>> > "Mike H" wrote:
>> >
>> >> Hi,
>> >>
>> >> I don't understand whay you mean by 'Same result'
>> >>
>> >> try it in an empty sub with no other code
>> >>
>> >> Sub version()
>> >> MsgBox Application.version
>> >> End Sub
>> >>
>> >> Mike
>> >>
>> >> "oldjay" wrote:
>> >>
>> >> > I inserted "ThisVersion = Application.Version" as the first line of
>> >> > the
>> >> > Sub.
>> >> >
>> >> > Same result
>> >> >
>> >> > "Mike H" wrote:
>> >> >
>> >> > > Hi,
>> >> > >
>> >> > > Try this
>> >> > >
>> >> > > ThisVersion = Application.Version
>> >> > >
>> >> > > Mike
>> >> > >
>> >> > > "oldjay" wrote:
>> >> > >
>> >> > > > I am trying to test for various versions of office.
>> >> > > > The following doesn't work.
>> >> > > > Need help
>> >> > > >
>> >> > > >
>> >> > > > Private Sub CommandButton39_Click() 'Add new customer
>> >> > > > Dim X As String
>> >> > > > Dim Y As String
>> >> > > > Dim Z As String
>> >> > > >
>> >> > > > On Error GoTo ehandler3
>> >> > > >
>> >> > > > X = Shell("C:\Program Files\Microsoft
>> >> > > > Office\Office\MSACCESS.EXE
>> >> > > > \\SERVER3\database\customers.MDB", 1)
>> >> > > > Exit Sub
>> >> > > >
>> >> > > > ehandler3:
>> >> > > > On Error GoTo ehandler4
>> >> > > >
>> >> > > > Y = Shell("C:\Program Files\Microsoft
>> >> > > > Office\Office11\MSACCESS.EXE
>> >> > > > \\SERVER3\database\customers.MDB", 1)
>> >> > > > Exit Sub
>> >> > > >
>> >> > > > ehandler4:
>> >> > > >
>> >> > > > Z = Shell("C:\Program Files\Microsoft
>> >> > > > Office\Office12\MSACCESS.EXE
>> >> > > > \\SERVER3\database\customers.MDB", 1)
>> >> > > >
>> >> > > > End Sub

>>
>>
>>



 
Reply With Quote
 
oldjay
Guest
Posts: n/a
 
      9th Oct 2009
Thanks
Sorry I am so slow

oldjay

"Peter T" wrote:

> I don't understand the problem, you can test and respond for all versions.
>
> *warning air-code*
>
> Dim nVer as long
> Dim sFile as string
>
> nVer = Val(Application.Version)
>
> Select Case nVer
> Case 10 : sFile = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
> \\SERVER3\database\customers.MD" ' mdb ?
> Case 11 : sFile = "< the 2003 version>"
> Case 12: sFile = "< the 2007 cersion>"
> End select
>
> If Len(sFile) then
> result = Shell(sFile,1)
> else
> msgbox "File doesn't exist for use in Office 97 or 2000"
> End If
>
> Regards,
> Peter T
>
> "oldjay" <(E-Mail Removed)> wrote in message
> news:4FCDE10E-9883-4E4A-8810-(E-Mail Removed)...
> >I guess I don't explain my self very well. If you look at the Sub you will
> > see that I am trying to open an access database, I first must know what
> > Version of Office the user has. Then I must open that version and then
> > open
> > the customer database on a server. My problem is I can test for 2 versions
> > of
> > Office but not 3
> >
> > "Peter T" wrote:
> >
> >> Public gXLver As Long
> >>
> >> Sub test()
> >> gXLver = Val(Application.Version) ' in startup routine
> >>
> >> If gXLver >= 10 Then
> >> ' XL 2002, 2003, 2007
> >> ' (2010 will be 14)
> >> Else
> >> ' XL 97 Or 2000
> >> End If
> >>
> >> End Sub
> >>
> >> Depending on what you are doing you can't necessarily put XL2002+ methods
> >> in
> >> the same routine or even module. Even if the code doesn't get called in
> >> the
> >> earlier version a compile error can occur if the object or arguments in a
> >> built in function are nor recognized.
> >>
> >> Regards,
> >> Peter T
> >>
> >>
> >> "oldjay" <(E-Mail Removed)> wrote in message
> >> news:7702FF4B-60D7-4DE8-878D-(E-Mail Removed)...
> >> > This spreadsheet is used by different people using different versions
> >> > of
> >> > Office. The purpose is to detect which version they are using and open
> >> > the
> >> > proper Access database. It works for 2 version of Office but not 3.
> >> > I am wondering if you can have an On Error Goto ehandler3 under another
> >> > On
> >> > Error Goto ehandler2??
> >> >
> >> > "Mike H" wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I don't understand whay you mean by 'Same result'
> >> >>
> >> >> try it in an empty sub with no other code
> >> >>
> >> >> Sub version()
> >> >> MsgBox Application.version
> >> >> End Sub
> >> >>
> >> >> Mike
> >> >>
> >> >> "oldjay" wrote:
> >> >>
> >> >> > I inserted "ThisVersion = Application.Version" as the first line of
> >> >> > the
> >> >> > Sub.
> >> >> >
> >> >> > Same result
> >> >> >
> >> >> > "Mike H" wrote:
> >> >> >
> >> >> > > Hi,
> >> >> > >
> >> >> > > Try this
> >> >> > >
> >> >> > > ThisVersion = Application.Version
> >> >> > >
> >> >> > > Mike
> >> >> > >
> >> >> > > "oldjay" wrote:
> >> >> > >
> >> >> > > > I am trying to test for various versions of office.
> >> >> > > > The following doesn't work.
> >> >> > > > Need help
> >> >> > > >
> >> >> > > >
> >> >> > > > Private Sub CommandButton39_Click() 'Add new customer
> >> >> > > > Dim X As String
> >> >> > > > Dim Y As String
> >> >> > > > Dim Z As String
> >> >> > > >
> >> >> > > > On Error GoTo ehandler3
> >> >> > > >
> >> >> > > > X = Shell("C:\Program Files\Microsoft
> >> >> > > > Office\Office\MSACCESS.EXE
> >> >> > > > \\SERVER3\database\customers.MDB", 1)
> >> >> > > > Exit Sub
> >> >> > > >
> >> >> > > > ehandler3:
> >> >> > > > On Error GoTo ehandler4
> >> >> > > >
> >> >> > > > Y = Shell("C:\Program Files\Microsoft
> >> >> > > > Office\Office11\MSACCESS.EXE
> >> >> > > > \\SERVER3\database\customers.MDB", 1)
> >> >> > > > Exit Sub
> >> >> > > >
> >> >> > > > ehandler4:
> >> >> > > >
> >> >> > > > Z = Shell("C:\Program Files\Microsoft
> >> >> > > > Office\Office12\MSACCESS.EXE
> >> >> > > > \\SERVER3\database\customers.MDB", 1)
> >> >> > > >
> >> >> > > > End Sub
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between versions DaSaint Microsoft Outlook Discussion 0 9th Apr 2008 06:17 PM
Difference between IE versions Lando Chez Windows XP Internet Explorer 2 19th Jul 2005 11:35 PM
Difference between IE versions Lando Chez Windows XP Internet Explorer 0 17th Jul 2005 10:41 AM
Big difference in FP versions? DW Microsoft Frontpage 11 5th May 2005 12:52 PM
Difference between OEM Versions =?Utf-8?B?SnVsZXM=?= Windows XP Help 4 14th Feb 2005 03:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:55 PM.