Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro does not work inside Excel 2007

Got a problem with my 2003 macro inside excel 2007.
When I start that macro I get the error message below (translated from
german):

"error-No.: 1004
description: application- or objectdefinition error
modul: vba project
area: AddChart
code area: 11"

Has anyone an idea?

Andreas



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Macro does not work inside Excel 2007

Hi Andreas,

Can you please give the macro code? it is probably something that someone
could guess at, but if you give the code then we can be sure to give a better
answer.

Cheers,

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"Andreas Wiechmann" wrote:

Got a problem with my 2003 macro inside excel 2007.
When I start that macro I get the error message below (translated from
german):

"error-No.: 1004
description: application- or objectdefinition error
modul: vba project
area: AddChart
code area: 11"

Has anyone an idea?

Andreas




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro does not work inside Excel 2007

Hi Sean,



thanks for your answer. In the meantime I've localized the malfunction.



Look at this:



CodePosFlag = 11




'Darstellungsreihenfolge und Farbe festlegen


If Not IsNull(arrPlotOrder) Then


For i = 1 To .SeriesCollection.Count




++++++++++ '.ChartGroups(1).SeriesCollection(arrPlotOrder( i -
1)).PlotOrder = i

'.ChartGroups(1).SeriesCollection(i).Border.Col orIndex =

arrColorIndex(i)

Next i




End If




The instruction with the plus signs I have commented out and things are
working again.



But we have about one thousand of those files and no one is keen on changing
all included macros.



What do you think?



Regards



Andreas









"SeanC UK" schrieb im Newsbeitrag
...
Hi Andreas,

Can you please give the macro code? it is probably something that someone
could guess at, but if you give the code then we can be sure to give a
better
answer.

Cheers,

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"Andreas Wiechmann" wrote:

Got a problem with my 2003 macro inside excel 2007.
When I start that macro I get the error message below (translated from
german):

"error-No.: 1004
description: application- or objectdefinition error
modul: vba project
area: AddChart
code area: 11"

Has anyone an idea?

Andreas






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Macro does not work inside Excel 2007

Hi Andreas,

I have had a look at this and the same thing is happening for me. I am not
entirely sure why at the moment, but I have found that selecting the chart
before attempting this line appears to prevent the problem. I will try to
look into this more and will let you know if I discover the reason. Hopefully
someone else has already addressed this and will comment here. In the
meantime, try adding a line like this and see if it helps:

ActiveSheet.ChartObjects(1).Select

Obviously you will need to use the ChartObject index for your chart,

Once it has been selected the code appears to work. I found this
accidentally when I noticed that the code worked after I opened the workbook
in 2007 and selected the graph properties, then going back to the code and
saw that it worked, even though I hadn't changed any of the graph properties.
But then going back to 2003 caused the problem to occur there. However,
selecting the graph properties in 2003 again prevented the problem, but
reintroduced it to 2007! Therefore I added the select line to the macro and
it appears to run now in both.

As I said, I am not entirely sure why this is happening, and if I get time I
will look into it further. Let me know if this works for you. In my opinion,
if this works then it is a temporary workaround, knowing why this happens is
more important so that the code can be written to always work.

I imagine that you will have to be changing code in your macros, either to
add some lines or to comment out your line.

Either way, if you do find that you need to be changing code in 1000s of
workbooks then I would consider looking into writing something that can
automate this process; a bit more complicated, but in the long run it may
save you time and give you a method to update the workbooks in future, should
you need to do so again.

I hope this helps, and if I do find out why then I shall let you know, and
I'll be watching this post to see if anyone else can give an explanation.

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"Andreas Wiechmann" wrote:

Hi Sean,



thanks for your answer. In the meantime I've localized the malfunction.



Look at this:



CodePosFlag = 11




'Darstellungsreihenfolge und Farbe festlegen


If Not IsNull(arrPlotOrder) Then


For i = 1 To .SeriesCollection.Count




++++++++++ '.ChartGroups(1).SeriesCollection(arrPlotOrder( i -
1)).PlotOrder = i

'.ChartGroups(1).SeriesCollection(i).Border.Col orIndex =

arrColorIndex(i)

Next i




End If




The instruction with the plus signs I have commented out and things are
working again.



But we have about one thousand of those files and no one is keen on changing
all included macros.



What do you think?



Regards



Andreas









"SeanC UK" schrieb im Newsbeitrag
...
Hi Andreas,

Can you please give the macro code? it is probably something that someone
could guess at, but if you give the code then we can be sure to give a
better
answer.

Cheers,

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"Andreas Wiechmann" wrote:

Got a problem with my 2003 macro inside excel 2007.
When I start that macro I get the error message below (translated from
german):

"error-No.: 1004
description: application- or objectdefinition error
modul: vba project
area: AddChart
code area: 11"

Has anyone an idea?

Andreas







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
Formula in Excel does not work until after I double-click inside c raaaabert Excel Discussion (Misc queries) 7 June 8th 17 02:01 PM
why doesn't this simple macro work in excel 2007? ManhattanRebel Excel Discussion (Misc queries) 8 July 19th 08 06:37 PM
Excel 2007 - cannot get worksheet change macro to work [email protected] Excel Programming 5 October 24th 07 04:43 PM
Excel 2007 macro does not work Maritza Excel Programming 1 May 5th 07 12:23 AM
Excel 2003, can't setfocus in a textbox inside a multipage, tab key don work! carlosla Excel Programming 0 February 23rd 06 07:55 PM


All times are GMT +1. The time now is 11:19 AM.

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

About Us

"It's about Microsoft Excel"