![]() |
Excel 2003 to 2007 VBA Change
I was testing some Excel 2003 spreadsheets with Visual Basic programming, and
found one that does not work in Excel 2007. The code below gives a Type Mismatch error on the .MinimumScale = startmonth and the line afterward. It looks like in Excel 2007, you cannot use a string this way with the MinimumScale command. Startmonth and Stopmonth are dates from the beginning and the end of a month that are determined by a routine that goes through a list of dates until it finds these values. startmonth and stopmonth would have values like 01/01 and 01/31. This section of programming sets up the x axis of the graph using startmonth and stopmonth as the x axis min and max. I am way out of practice with Visual Basic programming, so any help would be greatly appreciated. Chart1.Activate ActiveChart.Axes(xlCategory).Select With ActiveChart.Axes(xlCategory) .MinimumScaleIsAuto = False .MaximumScaleIsAuto = False .MinimumScale = startmonth .MaximumScale = endmonth |
All times are GMT +1. The time now is 05:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com