LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
lee lee is offline
external usenet poster
 
Posts: 184
Default Compile error in 2003

The following code fails to compile in Excel 2003 because it uses methods
that are new to Excel 2007. Is there any way around this problem or do I
need to create a separate program for Excel 2003 and 2007?

'The code to add a tile for the chart and axes is different for Excel
2003 and 2007
If Application.Version = "11.0" Then
With ActiveChart
'Excel 2003 code
.HasTitle = True
.ChartTitle.Characters.Text = strTitle + Chr(10) + strSubTitle
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
strXAxis
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = strYAxis
End With
ElseIf Application.Version = "12.0" Then
With ActiveChart
'Excel 2007 code
.SetElement (msoElementChartTitleAboveChart)
.ChartTitle.Text = strTitle + Chr(10) + strSubTitle
.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
.Axes(xlCategory, xlPrimary).AxisTitle.Text = strXAxis
.SetElement (msoElementPrimaryValueAxisTitleRotated)
.Axes(xlValue, xlPrimary).AxisTitle.Text = "y-axis stryaxis"
End With
End If
 
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
visual basic compile error in excel 2003 poopscooper101 Excel Discussion (Misc queries) 2 March 7th 08 09:39 PM
compile error in hidden module autoexec.new in excel 2003 maurice Charts and Charting in Excel 1 January 1st 07 06:13 PM
Help with Compile Error in Excel Office 2003 Julian Cann Excel Discussion (Misc queries) 2 April 4th 05 02:35 AM
compile error in hidden module with excel 2003 Brian Murphy[_2_] Excel Programming 2 April 7th 04 11:21 PM


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