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 saving problem sunil bhati Excel Discussion (Misc queries) 1 January 12th 07 08:54 AM
Excel 2007 C# Charting problem [email protected] Charts and Charting in Excel 1 September 26th 06 02:46 AM
Problem in Excel 2007 Beta. Kam Excel Discussion (Misc queries) 0 August 10th 06 07:42 AM
Excel 2007 Beta Setup Problem Robert McNeil Setting up and Configuration of Excel 3 August 7th 06 08:02 PM
2007 Excel Chart Problem YokohamaGaijin Excel Discussion (Misc queries) 0 June 7th 06 02:56 AM


All times are GMT +1. The time now is 12:33 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"