PC Review


Reply
Thread Tools Rate Thread

Application Name differences between Excel 2003 and 2007

 
 
SteveM
Guest
Posts: n/a
 
      18th Aug 2009
My application exchanges info between Excel and a non-Office application. It
works fine in Excel 2003 because the ActiveWorkbook.Name it assigns to
ThisApp works when you get to AppActivate.

ThisApp = ActiveWorkbook.Name
.... 'programming sends commands to other app
AppActivate ThisApp 'come back to Excel
.... 'programming in Excel

However the ActiveWorkbook.Name assigned to ThisApp by Excel 2007 does not
work when you get to AppActivate. You get an 'object not found' error. It
does work if the first line is changed to read

ThisApp = ActiveWorkbook.Name & " [Compatibility Mode]"

How can I program to distinguish between the two Excel versions and format
ThisApp to correctly deliver the Excel workbook name to the AppActivate
command? Are there any other modes which I might have to contend with
(append to the Excel 2007 name to make it work)?

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      19th Aug 2009
I bet that there are people running versions of excel that include a letter
suffix (xl2002 and prior).

I'd use something like:
if val(application.version) = 12 then

And to save typing

select case val(application.version)
case is = 12 : msgbox "you are using xl2007"
case is = 11 : msgbox "you are using xl2003"
...
end select

Val() makes it a numeric test, too.



stanleydgromjr wrote:
>
> SteveM,
>
> The following code can be modified to suit your needs.
>
> Code:
> --------------------
>
>
> Sub ReturnExcelVersion()
> If Application.Version = "12.0" Then
> MsgBox "You are using Excel 2007."
> ElseIf Application.Version = "11.0" Then
> MsgBox "You are using Excel 2003."
> ElseIf Application.Version = "10.0" Then
> MsgBox "You are using Excel 2002."
> ElseIf Application.Version = "9.0" Then
> MsgBox "You are using Excel 2000."
> ElseIf Application.Version = "8.0" Then
> MsgBox "You are using Excel 97."
> ElseIf Application.Version = "7.0" Then
> MsgBox "You are using Excel 95."
> End If
> End Sub
>
>
> --------------------
>
> Have a great day,
> Stan
>
> --
> stanleydgromjr
> ------------------------------------------------------------------------
> stanleydgromjr's Profile: http://www.thecodecage.com/forumz/member.php?userid=503
> View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=126586


--

Dave Peterson
 
Reply With Quote
 
SteveM
Guest
Posts: n/a
 
      19th Aug 2009
So Stanley and Dave,

Now I can distinguish between Excel 2003 and 2007. Will 2007 >always<
require [Compatibility Mode] to be appended to the application.name to work
with AppActivate? Are there any other modes that might be required instead
(or even none at all), and if so, how do I determine them? I want to
account for all possible choices with programming to avoid errors.

"Dave Peterson" wrote:

> I bet that there are people running versions of excel that include a letter
> suffix (xl2002 and prior).
>
> I'd use something like:
> if val(application.version) = 12 then
>
> And to save typing
>
> select case val(application.version)
> case is = 12 : msgbox "you are using xl2007"
> case is = 11 : msgbox "you are using xl2003"
> ...
> end select
>
> Val() makes it a numeric test, too.
>
>
>
> stanleydgromjr wrote:
> >
> > SteveM,
> >
> > The following code can be modified to suit your needs.
> >
> > Code:
> > --------------------
> >
> >
> > Sub ReturnExcelVersion()
> > If Application.Version = "12.0" Then
> > MsgBox "You are using Excel 2007."
> > ElseIf Application.Version = "11.0" Then
> > MsgBox "You are using Excel 2003."
> > ElseIf Application.Version = "10.0" Then
> > MsgBox "You are using Excel 2002."
> > ElseIf Application.Version = "9.0" Then
> > MsgBox "You are using Excel 2000."
> > ElseIf Application.Version = "8.0" Then
> > MsgBox "You are using Excel 97."
> > ElseIf Application.Version = "7.0" Then
> > MsgBox "You are using Excel 95."
> > End If
> > End Sub
> >
> >
> > --------------------
> >
> > Have a great day,
> > Stan
> >
> > --
> > stanleydgromjr
> > ------------------------------------------------------------------------
> > stanleydgromjr's Profile: http://www.thecodecage.com/forumz/member.php?userid=503
> > View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=126586

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      19th Aug 2009
A few tests should let you know, right?

SteveM wrote:
>
> So Stanley and Dave,
>
> Now I can distinguish between Excel 2003 and 2007. Will 2007 >always<
> require [Compatibility Mode] to be appended to the application.name to work
> with AppActivate? Are there any other modes that might be required instead
> (or even none at all), and if so, how do I determine them? I want to
> account for all possible choices with programming to avoid errors.
>
> "Dave Peterson" wrote:
>
> > I bet that there are people running versions of excel that include a letter
> > suffix (xl2002 and prior).
> >
> > I'd use something like:
> > if val(application.version) = 12 then
> >
> > And to save typing
> >
> > select case val(application.version)
> > case is = 12 : msgbox "you are using xl2007"
> > case is = 11 : msgbox "you are using xl2003"
> > ...
> > end select
> >
> > Val() makes it a numeric test, too.
> >
> >
> >
> > stanleydgromjr wrote:
> > >
> > > SteveM,
> > >
> > > The following code can be modified to suit your needs.
> > >
> > > Code:
> > > --------------------
> > >
> > >
> > > Sub ReturnExcelVersion()
> > > If Application.Version = "12.0" Then
> > > MsgBox "You are using Excel 2007."
> > > ElseIf Application.Version = "11.0" Then
> > > MsgBox "You are using Excel 2003."
> > > ElseIf Application.Version = "10.0" Then
> > > MsgBox "You are using Excel 2002."
> > > ElseIf Application.Version = "9.0" Then
> > > MsgBox "You are using Excel 2000."
> > > ElseIf Application.Version = "8.0" Then
> > > MsgBox "You are using Excel 97."
> > > ElseIf Application.Version = "7.0" Then
> > > MsgBox "You are using Excel 95."
> > > End If
> > > End Sub
> > >
> > >
> > > --------------------
> > >
> > > Have a great day,
> > > Stan
> > >
> > > --
> > > stanleydgromjr
> > > ------------------------------------------------------------------------
> > > stanleydgromjr's Profile: http://www.thecodecage.com/forumz/member.php?userid=503
> > > View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=126586

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
 
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
excel 2007 differences to 2003 questions George Applegate Microsoft Excel Misc 0 4th May 2009 08:41 PM
can you summarize differences between Excel 2000, 2003 & 2007? LSL Microsoft Excel Misc 2 7th Aug 2008 03:39 PM
The Differences in the Shell Command in Excel 2003 and 2007 Philosophaie Microsoft Excel Programming 1 9th Jul 2008 01:45 PM
Excel Macros - Any Major Differences Between 2003 and 2007 =?Utf-8?B?Yms=?= Microsoft Excel Worksheet Functions 1 20th Nov 2007 03:56 PM
Differences between Excel 2003 & 2007? Arcadian Microsoft Excel Discussion 5 27th Apr 2007 08:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:03 PM.