Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro which works in excel 2000 does not work in excel 2002


Hi,

I have this code in the Worksheet/SheetCalculate event of my excel
sheet which was created in excel 2000. It works very well. However
when the same worksheet in opened in excel 2002 and a cell value
changed . It does not execute the function as the unprotect worksheet
code does not work in excel 2002.

Can anyone help me with this. This is my code which works well in excel
2000.

ActiveSheet.Unprotect
On Error GoTo ERRMSG
ActiveSheet.Shapes("SudhirP").Select
Selection.Cut
Range("d22:d36").Select
With Selection
..HorizontalAlignment = xlLeft
..VerticalAlignment = xlTop
..WrapText = True
..Orientation = 0
..AddIndent = False
..IndentLevel = 0
..ShrinkToFit = False
..MergeCells = False
End With
Range("d37").Select
ERRMSG:
Range("d22:d36").Select
With Selection
..HorizontalAlignment = xlLeft
..VerticalAlignment = xlTop
..WrapText = True
..Orientation = 0
..AddIndent = False
..IndentLevel = 0
..ShrinkToFit = False
..MergeCells = False
End With
ActiveSheet.Protect DrawingObjects:=False, Contents:=True,
Scenarios:=True
Range("a1").Select

thanks
Neeta


--
nnayak
------------------------------------------------------------------------
nnayak's Profile: http://www.excelforum.com/member.php...o&userid=35493
View this thread: http://www.excelforum.com/showthread...hreadid=552655

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default macro which works in excel 2000 does not work in excel 2002

It should work. Perhaps you need to use the . 's in your with statements.

ActiveSheet.Unprotect
'On Error GoTo ERRMSG '?????
ActiveSheet.Shapes("SudhirP").Cut
with Range("d22:d36")
' .HorizontalAlignment = xlLeft'need?
' .VerticalAlignment = xlTop 'need?
.WrapText = True
End With
'Range("d37").Select
ActiveSheet.Protect DrawingObjects:=False, _
Contents:=True,Scenarios:=True




'don't understand this
ERRMSG:
Range("d22:d36").Select
With Selection
HorizontalAlignment = xlLeft
VerticalAlignment = xlTop
WrapText = True
Orientation = 0
AddIndent = False
IndentLevel = 0
ShrinkToFit = False
MergeCells = False
End With
ActiveSheet.Protect DrawingObjects:=False, Contents:=True,
Scenarios:=True
Range("a1").Select

--
Don Guillett
SalesAid Software

"nnayak" wrote in
message ...

Hi,

I have this code in the Worksheet/SheetCalculate event of my excel
sheet which was created in excel 2000. It works very well. However
when the same worksheet in opened in excel 2002 and a cell value
changed . It does not execute the function as the unprotect worksheet
code does not work in excel 2002.

Can anyone help me with this. This is my code which works well in excel
2000.

ActiveSheet.Unprotect
On Error GoTo ERRMSG
ActiveSheet.Shapes("SudhirP").Select
Selection.Cut
Range("d22:d36").Select
With Selection
HorizontalAlignment = xlLeft
VerticalAlignment = xlTop
WrapText = True
Orientation = 0
AddIndent = False
IndentLevel = 0
ShrinkToFit = False
MergeCells = False
End With
Range("d37").Select
ERRMSG:
Range("d22:d36").Select
With Selection
HorizontalAlignment = xlLeft
VerticalAlignment = xlTop
WrapText = True
Orientation = 0
AddIndent = False
IndentLevel = 0
ShrinkToFit = False
MergeCells = False
End With
ActiveSheet.Protect DrawingObjects:=False, Contents:=True,
Scenarios:=True
Range("a1").Select

thanks
Neeta


--
nnayak
------------------------------------------------------------------------
nnayak's Profile:
http://www.excelforum.com/member.php...o&userid=35493
View this thread: http://www.excelforum.com/showthread...hreadid=552655



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
Simple Macro, works in Excel 2002, 2003 but won't work in 2000 DJA[_2_] Excel Programming 5 September 28th 05 05:10 PM
sendmail works in excel 2002 but not 2000 RogueSwan Excel Programming 3 April 15th 05 06:14 PM
Code works with Excel 2000 but not with Excel 2002 La Durande Excel Programming 0 September 17th 04 09:46 PM
Code works with Excel 2000 but not with Excel 2002 Tom Ogilvy Excel Programming 0 September 17th 04 09:21 PM
Code works with Excel 2000 but not with Excel 2002 La Durande Excel Programming 0 September 17th 04 08:49 PM


All times are GMT +1. The time now is 06:50 PM.

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"