ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro works fine in xl2002 but does not in xl 2000 (https://www.excelbanter.com/excel-programming/292152-macro-works-fine-xl2002-but-does-not-xl-2000-a.html)

Nolin[_2_]

Macro works fine in xl2002 but does not in xl 2000
 
Hi!
The following code work fine in xl2002 but wont work in xl2000.
I have 2 buttons that run the following code, could someone take a loo
and tell me why it does not work.

Thanks for your help,
Nolin


Private Sub btnHide_Click()
On Error Resume Next
Application.ActiveWorkbook.Unprotect
Application.ActiveSheet.Unprotect
Application.ScreenUpdating = False
Worksheets("Purchase").ScrollArea = ("a1:i60")
Worksheets("Purchase").Range("f24:i29").Cut
Worksheets("Purchase").Paste Destination:=Worksheet
_("Purchase").Range("f54:i59")
Worksheets("Purchase").Range("f24:i29").Select
Selection.Interior.Color = RGB(223, 223, 232)
Worksheets("Purchase").Range("d10").Select
Worksheets("Purchase").btnHide.Visible = False
Worksheets("Purchase").btnShow.Visible = True
Worksheets("Purchase").Image4.Visible = True
Worksheets("Purchase").ScrollArea = ("a1:i29")
Application.ScreenUpdating = True
Application.ActiveSheet.Protect
Application.ActiveWorkbook.Protect

End Sub

Private Sub btnShow_Click()
Application.ActiveWorkbook.Unprotect
Application.ActiveSheet.Unprotect
Application.ScreenUpdating = False
Worksheets("Purchase").ScrollArea = ("a1:i60")
Worksheets("Purchase").Range("f54:i59").Cut
Worksheets("Purchase").Paste Destination:=Worksheet
_("Purchase").Range("f24:i29")
Worksheets("Purchase").Range("g25").Select
Worksheets("Purchase").btnShow.Visible = False
Worksheets("Purchase").btnHide.Visible = True
Worksheets("Purchase").Image4.Visible = False
Worksheets("Purchase").ScrollArea = ("a1:i29")
Application.ScreenUpdating = True
Application.ActiveSheet.Protect
Application.ActiveWorkbook.Protect

End Su

--
Message posted from http://www.ExcelForum.com


jasonsweeney[_52_]

Macro works fine in xl2002 but does not in xl 2000
 
Nolin,

I too am having trouble getting code written in XL 2002 to work whe
run on XL 2000. One issue I noticed, however, is that if the user o
XL2000 has kept their XL updated with service packs, then the macro
work. I don't know what service pack fixs the problem though.

Another suggestion: Trap the line in your code that is causing th
hangup and post the error on these pages. I do this by inserting:

msgbox ("A")
1st line of code
msgbox("B")
2ndline of text

etc. When the macro runs on XL2000 you can find which line causes th
problem


I have another post out there where I ask the similar question and I a
asking for some feedback. Use search option on this forum fo
username: "jasonsweeney" and see my related post

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com