macro 2003 error 2007

M

MS GVE

We have a Excel sheet that loads raw data from csv files.
On excelö 2003 and below works perfectly but on 2007 we get application or
object defined error.
When calling OnAction from ChartObjects, I'd tried to find a soilution and
so far none has been satisfactry, Is ther a way not to recode and use a kind
of compatibility mode...
IS quite annoing that former versions of OFFICE cant be supported.
example :-----
Option Explicit
Private Sub Worksheet_Activate()
Dim ch_ As ChartObject
For Each ch_ In Me.ChartObjects
ch_.OnAction = "'" & ThisWorkbook.Name & "'!Cover.ZoomChart"
Next ch_
Range("B3").Select
End Sub
 
M

MS GVE

Has someone any IDEA why excel 2007 does not run code made on 2003?

How i can enable the OnAction it says it does not exist, if open the same
 
G

GVE

Anyone can help Please why Microsoft does not give backwards compatibility?
At least by now we are now recommending our customers using the application
not to upgrade to 2007, due we have not got response of this.

Please anyone whom might help explainning the issue (see code) and how wwe
can make it work with minimal modification or if there is a plugin or feature
where to enable 2003 excel versions run on 2007 i've tried to convert the app
and no luck.

Thanks in advance
 
C

Chip Pearson

I have had no problems at all using workbooks created in 2003 in 2007,
nor have I had problems using workbooks created in 2007 in 2003
(assuming they don't implement features new to 2007). If you don't
intend on using any of the new features of 2007, you can just open the
2003 workbook in 2007 and 2007 will enter compatibility mode. Changes
made in 2007, as long as those features exist in 2003, will be
available when you open the workbook later in 2003. MS also has a
compatibility pack that allows you to open 2007 workbooks within 2003.
In this case, of course, you can't use any new 2007 features, but
you'll have full 2003 functionality in a 2007 workbook.

Just for testing, I created a workbook in 2003 with a single
ChartObject on Sheet1 and then ran the following code:

Sub AAA()
Dim ChtObj As ChartObject
Set ChtObj = ThisWorkbook.Worksheets(1).ChartObjects(1)
ChtObj.OnAction = "TestMe"
End Sub

Sub TestMe()
MsgBox "hello"
End Sub

When I click on the ChartObject, I get the message box.

Then, I created an identical workbook in 2007, saved it as a 2003
compatible workbook, opened it in 2003, and everything worked as
expected.

In short, MS does indeed provide backwards compatibility (you can
still use XLM, for God's sake, that was made obsolete nearly 15 years
ago).

I cannot replicate the problem you report. If you want, you can email
the workbook to (e-mail address removed) and I'll have a look at it.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top