ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA error (https://www.excelbanter.com/excel-programming/320682-excel-vba-error.html)

leena

Excel VBA error
 
Hi
I have recorded a macro to sort within a range and have assigned it to a
forms-button. It runs well while executing on XP machine. But people who try
to run it from their 2000 OS get the following error.
"Can't execute code in break mode"
I am not able to reproduce this error on my XP machinee. Please help

Bob Phillips[_7_]

Excel VBA error
 
Can you post the code?

--
HTH

-------

Bob Phillips
"Leena" wrote in message
...
Hi
I have recorded a macro to sort within a range and have assigned it to a
forms-button. It runs well while executing on XP machine. But people who

try
to run it from their 2000 OS get the following error.
"Can't execute code in break mode"
I am not able to reproduce this error on my XP machinee. Please help




leena

Excel VBA error
 
Hi Bob,
The code is as follows. This works perfectly well on XP but gives an error
on 2000.

Sub sortmanagermajor()
'Range("C2").Select
Range("A1:lastcellmajor").Sort Key1:=Range("C2"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Thanks in advance
"Bob Phillips" wrote:

Can you post the code?

--
HTH

-------

Bob Phillips
"Leena" wrote in message
...
Hi
I have recorded a macro to sort within a range and have assigned it to a
forms-button. It runs well while executing on XP machine. But people who

try
to run it from their 2000 OS get the following error.
"Can't execute code in break mode"
I am not able to reproduce this error on my XP machinee. Please help





Tom Ogilvy

Excel VBA error
 
I assume "lastcellmajor" is a defined name/range.

Try changing it to this

Sub sortmanagermajor()
'Range("C2").Select
Range("A1:lastcellmajor").Sort _
Key1:=Range("C2"), Order1:=xlAscending,
Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub

I don't think xl2000 supported the DataOption1 argument (and it isn't
needed).

To get out of break mode, in the vbe, hit the reset button.

--
Regards,
Tom Ogilvy


"Leena" wrote in message
...
Hi Bob,
The code is as follows. This works perfectly well on XP but gives an error
on 2000.

Sub sortmanagermajor()
'Range("C2").Select
Range("A1:lastcellmajor").Sort Key1:=Range("C2"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Thanks in advance
"Bob Phillips" wrote:

Can you post the code?

--
HTH

-------

Bob Phillips
"Leena" wrote in message
...
Hi
I have recorded a macro to sort within a range and have assigned it to

a
forms-button. It runs well while executing on XP machine. But people

who
try
to run it from their 2000 OS get the following error.
"Can't execute code in break mode"
I am not able to reproduce this error on my XP machinee. Please help







Fredrik Wahlgren

Excel VBA error
 

"Leena" wrote in message
...
Hi
I have recorded a macro to sort within a range and have assigned it to a
forms-button. It runs well while executing on XP machine. But people who

try
to run it from their 2000 OS get the following error.
"Can't execute code in break mode"
I am not able to reproduce this error on my XP machinee. Please help


Are you sure the macro sorts exactly the same data on both machines?

/Fredrik



JulieD

Excel VBA error
 
Hi Leena

remove
, _
DataOption1:=xlSortNormal

from your code and see if it works - i think i've had this problem in the
past where a macro recorded in 2003 puts this parameter in but it's not
supported in 2000.

Cheers
JulieD

"Leena" wrote in message
...
Hi Bob,
The code is as follows. This works perfectly well on XP but gives an error
on 2000.

Sub sortmanagermajor()
'Range("C2").Select
Range("A1:lastcellmajor").Sort Key1:=Range("C2"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Thanks in advance
"Bob Phillips" wrote:

Can you post the code?

--
HTH

-------

Bob Phillips
"Leena" wrote in message
...
Hi
I have recorded a macro to sort within a range and have assigned it to
a
forms-button. It runs well while executing on XP machine. But people
who

try
to run it from their 2000 OS get the following error.
"Can't execute code in break mode"
I am not able to reproduce this error on my XP machinee. Please help








All times are GMT +1. The time now is 05:07 PM.

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