Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 623
Default Excel quits when executing Activesheet.Name instruction

I have a macro which has worked hundreds of times before.

Now, the macro quits when it gets to an Activesheet.Name = "Export" command. By
quitting, I mean it's just as if it encountered an Exit Sub command.

What would cause such strange behavior? I have other macros with
Activesheet.Name in them, and they still work. I first encountered this problem
at work where we have Office 2003 and Windows 2003. I find I have the same
problem at home, where I'm running Office XP and Windows XP.

When I step through the macro using F8, it highlights Activesheet.Name command
properly. As soon as I hit F8, the macro quits -- the yellow highlight
disappears and a data entry cursor appears. If I hit F8 again, the macro starts
over at the Sub command.

Any suggestions from anyone?

--
Regards,
Fred



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Excel quits when executing Activesheet.Name instruction

Do you have workbook protection on? This may stop you renaming sheets.
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Fred Smith" wrote:

I have a macro which has worked hundreds of times before.

Now, the macro quits when it gets to an Activesheet.Name = "Export" command. By
quitting, I mean it's just as if it encountered an Exit Sub command.

What would cause such strange behavior? I have other macros with
Activesheet.Name in them, and they still work. I first encountered this problem
at work where we have Office 2003 and Windows 2003. I find I have the same
problem at home, where I'm running Office XP and Windows XP.

When I step through the macro using F8, it highlights Activesheet.Name command
properly. As soon as I hit F8, the macro quits -- the yellow highlight
disappears and a data entry cursor appears. If I hit F8 again, the macro starts
over at the Sub command.

Any suggestions from anyone?

--
Regards,
Fred




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Excel quits when executing Activesheet.Name instruction

Is the statement executed (i.e is ActiveSheet renamed to "Export") before
the macro quits or is the statement itself causing this behavior?


"Fred Smith" wrote in message
...
I have a macro which has worked hundreds of times before.

Now, the macro quits when it gets to an Activesheet.Name = "Export"

command. By
quitting, I mean it's just as if it encountered an Exit Sub command.

What would cause such strange behavior? I have other macros with
Activesheet.Name in them, and they still work. I first encountered this

problem
at work where we have Office 2003 and Windows 2003. I find I have the same
problem at home, where I'm running Office XP and Windows XP.

When I step through the macro using F8, it highlights Activesheet.Name

command
properly. As soon as I hit F8, the macro quits -- the yellow highlight
disappears and a data entry cursor appears. If I hit F8 again, the macro

starts
over at the Sub command.

Any suggestions from anyone?

--
Regards,
Fred





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 623
Default Excel quits when executing Activesheet.Name instruction

Workbook protection is not on.

The statement actually executes (ie, the sheet is renamed to "Export") before
the macro quits. In addition, I can see the workbook being recalculated just
after the rename, even though there's no Recalculation statement in the
vicinity.

Let me know of any ideas you have.

--
Regards,
Fred


"Joerg" wrote in message
...
Is the statement executed (i.e is ActiveSheet renamed to "Export") before
the macro quits or is the statement itself causing this behavior?


"Fred Smith" wrote in message
...
I have a macro which has worked hundreds of times before.

Now, the macro quits when it gets to an Activesheet.Name = "Export"

command. By
quitting, I mean it's just as if it encountered an Exit Sub command.

What would cause such strange behavior? I have other macros with
Activesheet.Name in them, and they still work. I first encountered this

problem
at work where we have Office 2003 and Windows 2003. I find I have the same
problem at home, where I'm running Office XP and Windows XP.

When I step through the macro using F8, it highlights Activesheet.Name

command
properly. As soon as I hit F8, the macro quits -- the yellow highlight
disappears and a data entry cursor appears. If I hit F8 again, the macro

starts
over at the Sub command.

Any suggestions from anyone?

--
Regards,
Fred







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 quits unexpectedly Simon Brown Excel Worksheet Functions 1 May 4th 07 11:36 PM
VBA (excel) quits on workbooks.open Nicholas Dreyer Excel Programming 7 November 4th 06 11:24 AM
Excel quits when saving Macro spreadsheets Shake''n''Bake Wagner Excel Discussion (Misc queries) 0 August 2nd 06 09:41 PM
excel will not bold a cell, then program quits mastermachanic Excel Worksheet Functions 0 March 1st 05 02:29 AM
excel will not bold a cell, then program quits mastermachanic Excel Worksheet Functions 0 March 1st 05 02:29 AM


All times are GMT +1. The time now is 06:04 AM.

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"