Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
in excel 2000 work sheet excel commands are showing how to rectif | Excel Worksheet Functions | |||
copy from Excel 97 output put in Excel 2000, colors don't work | Excel Worksheet Functions | |||
Hyperlinks from Excel 2000 dont work anymore in Excel 2003 | Excel Discussion (Misc queries) | |||
How do I update Excel 2000 macros to work in Excel 2002? | Excel Discussion (Misc queries) | |||
Excel VBA Code Execution Excel XP Vs Excel Office 2000 | Excel Programming |