Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default 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


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
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 05:30 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"