Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Why won't this Excel 2000 code work for Excel '97?

I am developing in Excel 2000 for an application that
will be run in Excel '97 (and then eventually 2000).
This workbook has a sheet with 3 embedded charts on it.
The data source for the charts is external to this
workbook.

This workbook also has a worksheet which is divided into
4 quadrants of data. One of these quadrants is displays
one of the 3 embedded charts. The user can alternate
showing any of the 3 charts in this quadrant by just
selecting an option button. The option button runs the
code segment below.

(BTW, this is a brute force method - as it is copied from
a macro recording. Tried to clean it up by removing lines
like:
Windows(ThisWorkbook.Name).Activate
Actually, I guess my first question 1 is, why doesn't
Excel 2000 like this line removed from the code segment
below? I only have one workbook open)

Question 2: When I open this workbook in Excel '97, all
works fine EXCEPT the last line of code in the segment
below. It fails on
Windows(ThisWorkbook.Name).Activate
Any ideas why?
-------------------------

Application.ScreenUpdating = False
ActiveSheet.ChartObjects("theChart").Delete
ActiveSheet.Shapes("Legend").Delete
Sheets("Sheet1").Select
ActiveSheet.ChartObjects("Counts").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Windows(ThisWorkbook.Name).Activate
Sheets("Quad Chart").Select
ActiveSheet.Paste
ActiveSheet.ChartObjects(1).Activate
ActiveSheet.ChartObjects(1).Name = "theChart"
theTop = ActiveSheet.Shapes("theChart").Top
theLeft = ActiveSheet.Shapes("theChart").Left
ActiveSheet.Shapes("theChart").IncrementTop -(theTop)
ActiveSheet.Shapes("theChart").IncrementLeft -
(theLeft)
ActiveSheet.Shapes("theChart").IncrementLeft 130
ActiveSheet.Shapes("theChart").IncrementTop
ActiveSheet.Shapes("lblProgramHealth").Top + 15
ActiveWindow.Visible = False
Windows(ThisWorkbook.Name).Activate


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
in excel 2000 work sheet excel commands are showing how to rectif murthy Excel Worksheet Functions 1 November 17th 07 02:08 AM
copy from Excel 97 output put in Excel 2000, colors don't work Margie Excel Worksheet Functions 1 June 22nd 07 10:01 PM
Hyperlinks from Excel 2000 dont work anymore in Excel 2003 Agron Shujaku Excel Discussion (Misc queries) 0 January 18th 06 02:21 PM
How do I update Excel 2000 macros to work in Excel 2002? BobPetrich Excel Discussion (Misc queries) 3 January 4th 05 04:06 PM
Excel VBA Code Execution Excel XP Vs Excel Office 2000 John Flynn Excel Programming 6 August 24th 03 04:58 AM


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