Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Excel 2007 VBA problem

Hello

Could any knowledgable person please help.

I try to run a VBA code that woks fine in Excel 2003 and it crashes in 2007.

The offending line is

ActiveSheet.ChartObjects("Chart 542").Activate

What could possibly be wrong with that?

Is it me or is Excel 2007 not there yet?


  #2   Report Post  
Posted to microsoft.public.excel.programming, microsoft.public.excel.misc
external usenet poster
 
Posts: 422
Default Excel 2007 VBA problem

Try
Replacing: Activesheet
with:
Sheets("MySheet")

my 2 cents...


"teepee" wrote in message
:

Hello

Could any knowledgable person please help.

I try to run a VBA code that woks fine in Excel 2003 and it crashes in 2007.

The offending line is

ActiveSheet.ChartObjects("Chart 542").Activate

What could possibly be wrong with that?

Is it me or is Excel 2007 not there yet?


  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel 2007 VBA problem

I probably spend more time addressing issues related to
drawingobjects/shapes when trying to get my apps to run in XL07 than
anything else. Strangely enough though your code runs fine for me. Even
the recorder records the same code.

--
Jim
"teepee" wrote in message
...
| Hello
|
| Could any knowledgable person please help.
|
| I try to run a VBA code that woks fine in Excel 2003 and it crashes in
2007.
|
| The offending line is
|
| ActiveSheet.ChartObjects("Chart 542").Activate
|
| What could possibly be wrong with that?
|
| Is it me or is Excel 2007 not there yet?
|
|


  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Excel 2007 VBA problem


"Jim Rech" wrote in message
...
I probably spend more time addressing issues related to
drawingobjects/shapes when trying to get my apps to run in XL07 than
anything else. Strangely enough though your code runs fine for me. Even
the recorder records the same code.

Yes my recorder does the same. Bizarre.


  #5   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Excel 2007 VBA problem

I recorded the following in 2007

Sub Macro1()
'
' Macro1 Macro
'

'
ActiveSheet.ChartObjects("Chart 542").Activate
ActiveChart.PlotArea.Select
ActiveSheet.ChartObjects("Chart 541").Activate
ActiveChart.PlotArea.Select
ActiveSheet.ChartObjects("Chart 543").Activate
ActiveChart.PlotArea.Select
Selection.Left = 3.75
Selection.Top = 2.75
Range("E22").Select
End SubSub Macro1()

And when I ran it it still crashed on the first line




  #6   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Excel 2007 VBA problem

Weirder still, if I create a sheet within 2007 it has no problem with the
commands but if it's created within 2003 it can't cope.


  #7   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Excel 2007 VBA problem

I found the problem. The sheet protection option that allows for editing
objects doesn't work in 2007


  #8   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Excel 2007 VBA problem

Jim

It is acknowledged that this is 'broken' in XL2007. The charts and drawing
objects (now SmartArt) are shared across apps (Word/Excel/PowerPoint), so it
will take an SP or v.next I suspect for the object model/recorder to catch
up properly. It always becomes an issue when different teams get involved
across apps

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk
blog: www.nickhodge.co.uk/blog/

FREE UK OFFICE USER GROUP MEETING, MS READING, 27th APRIL 2007
www.officeusergroup.co.uk

"Jim Rech" wrote in message
...
I probably spend more time addressing issues related to
drawingobjects/shapes when trying to get my apps to run in XL07 than
anything else. Strangely enough though your code runs fine for me. Even
the recorder records the same code.

--
Jim
"teepee" wrote in message
...
| Hello
|
| Could any knowledgable person please help.
|
| I try to run a VBA code that woks fine in Excel 2003 and it crashes in
2007.
|
| The offending line is
|
| ActiveSheet.ChartObjects("Chart 542").Activate
|
| What could possibly be wrong with that?
|
| Is it me or is Excel 2007 not there yet?
|
|



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
Excel 2007 IRM problem gwaxiom Excel Discussion (Misc queries) 0 November 20th 09 05:52 PM
Excel 2007 Query Wizard problem with Access 2007 extensions Showdad Excel Discussion (Misc queries) 0 December 4th 08 05:57 PM
Problem with Excel 2007 Jim Peterson Excel Discussion (Misc queries) 0 September 19th 08 05:38 PM
Excel 2007 Bug or other problem Kevin Lutz Excel Discussion (Misc queries) 0 July 17th 07 04:08 PM
Excel 2007 VBA problem teepee Excel Discussion (Misc queries) 7 March 31st 07 10:56 AM


All times are GMT +1. The time now is 03:02 AM.

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

About Us

"It's about Microsoft Excel"