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: 80
Default Backward compatability

Hi All,

I have developed a workbook in Excel 2003 with a lot of VBA code. I was
originally told that all the users were on Excel 2003 but it transpires that
a number are on Excel 97 & 2000 and l am trying to 'modify' the workbook to
work on all versions from 97 upwards.

The following code (A) is giving me real problems. It works perfectly well
in Excel 2003 but always crashes in Excel 97. I pretty sure it is to do with
the method of hiding / unhiding columns. The macro recorder in Excel 97
records the code at (B) but l am pretty sure that you should be able to set
the column properties without having to select the column ranges.

The code is attached to a cbx _Change event

Can anybody tell me what is wrong with the code ?
Secondly will the solution needs to run on Excel 2000 & 2003 as well as 97

All help gratefully appreciated

xxxxx Code A - Excel 2003 xxxxxxxxxxxxxxxxxxxxxxxx
Private Sub cbxPrimaryRole_Change()

Dim ColRef
On Error Resume Next
ActiveSheet.Unprotect ("mbNOMIS7")
Columns("F:CZ").Hidden = True

If Range("DQ2").Value = 0 Then
ColRef = "ALL"
Else
ColRef = Range("DQ2").Value
End If

If ColRef = "ALL" Then
Columns("F:CZ").Hidden = False
Else
Columns(ColRef).Hidden = False
End If
ActiveSheet.Protect ("mbNOMIS7")
On Error GoTo 0

End Sub

xxxxxx Code B - Excel 97 xxxxxxxxxxx

Range("F11:CZ11").Select
Selection.EntireColumn.Hidden = False



Regards

Michael Beckinsale


 
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
vlookup backward [email protected] Excel Worksheet Functions 8 December 24th 09 04:46 AM
Excel 2007 backward compatability? Reggie D.[_2_] New Users to Excel 4 October 16th 08 03:01 PM
Backward Formula AL Excel Discussion (Misc queries) 7 October 25th 07 09:34 PM
Backward worksheets ... Annie777057 Setting up and Configuration of Excel 3 February 4th 05 02:17 AM
Worksheet name and Backward compatibility Rich Excel Discussion (Misc queries) 3 November 30th 04 06:10 PM


All times are GMT +1. The time now is 10:00 PM.

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"