LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default What's up with VBA (?)

Hi,

I've migrated to Excel 2007 with my work documents and encountered numerous
problems. One of them is related to simple macro's that switch input for
scatter chart month after month.
The old Excel (v.2003) generated this macro:
/////////////////////////////////////////////////////////////////////////////////////////////////////////
Sub jan()
'
' jan Macro
' Macro recorded 4.4.2006 by Me
'

'
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
Application.Run "OnGenericSetSheetActive"
ActiveChart.SeriesCollection(1).XValues = "=QP!R6C6:R37C6"
ActiveChart.SeriesCollection(1).Values = "=QP!R6C5:R37C5"
ActiveChart.SeriesCollection(1).BubbleSizes = "=QP!R6C4:R37C4"
ActiveWindow.Visible = False
Windows("some_document.xls").Activate
Application.Run "OnGenericSetSheetActive"
End Sub
//////////////////////////////////////////////////////////////////////////////////////////////////////////

PROBLEM 1:
Excel 2007 does't run this code. It stops on line 3 and then 4,5...
I've found out that it doesn't recognize this R1C1 reference style so with a
little tuning it worked with this code below:
//////////////////////////////////////////////////////////////////////////////////////////////////////////

Sub jan()
'
' jan Macro
' Macro recorded 9.1.2006 by Me
'

'
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).XValues = "=QP!$F$6:$F$37"
ActiveChart.SeriesCollection(1).Values = "=QP!$E$6:$E$37"
ActiveChart.SeriesCollection(1).BubbleSizes = "=QP!$D$6:$D$37"
ActiveSheet.ChartObjects("Chart 1").Activate
End Sub
//////////////////////////////////////////////////////////////////////////////////////////////////////////
So, this one (reduced and non-R1C1 style) gives the same effect and the
result as the old version.

PROBLEM 2 (general one):
When I save document as an old version (so the coleagues can open with their
old Excel's) and distribute "report" they can't use this macro I've adjusted
(the similar error occures to them).

Can anyone help me figuring out how to fix this???

I tought that VBA is a standard working wherever you need it but...


BR


Kruno



 
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



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