Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default VBA crashes Excel

Hi,

The following seemingly innocent routines sometimes crashes excel with one
of those "Send Report" messages. This persists every time Excel is
restarted. Sometimes rebooting the machine helps.

"My Template" is a legitimate hidden worksheet.


Sub gNewSheet()
Dim desiredName As String

desiredName = InputBox("Enter the new portfolio name:", "Sheet Name")

If (desiredName = "") Then
Exit Sub
End If

Sheets("My Template").Copy After:=ActiveSheet
ActiveSheet.Name = Left(desiredName, 31)
ActiveSheet.Range("Response") = ""
ActiveSheet.Range("NameCell") = desiredName

ActiveSheet.Visible = True
End Sub


Many Thanks!

Bura


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default VBA crashes Excel

Bura

I tried your code on my machine, and the good/bad news is that it all works
perfectly!

I wish I could get it to crash for you. Have you tried your code on another
PC?

Geoff




"Bura Tino" wrote in message
news:mAghb.74715$%h1.62162@sccrnsc02...
Hi,

The following seemingly innocent routines sometimes crashes excel with one
of those "Send Report" messages. This persists every time Excel is
restarted. Sometimes rebooting the machine helps.

"My Template" is a legitimate hidden worksheet.


Sub gNewSheet()
Dim desiredName As String

desiredName = InputBox("Enter the new portfolio name:", "Sheet Name")

If (desiredName = "") Then
Exit Sub
End If

Sheets("My Template").Copy After:=ActiveSheet
ActiveSheet.Name = Left(desiredName, 31)
ActiveSheet.Range("Response") = ""
ActiveSheet.Range("NameCell") = desiredName

ActiveSheet.Visible = True
End Sub


Many Thanks!

Bura




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default VBA crashes Excel

Bura - It gets worse! I just added nearly 200 worksheets using your macro,
and it all worked perfectly.

Geoff




"Bura Tino" wrote in message
news:mAghb.74715$%h1.62162@sccrnsc02...
Hi,

The following seemingly innocent routines sometimes crashes excel with one
of those "Send Report" messages. This persists every time Excel is
restarted. Sometimes rebooting the machine helps.

"My Template" is a legitimate hidden worksheet.


Sub gNewSheet()
Dim desiredName As String

desiredName = InputBox("Enter the new portfolio name:", "Sheet Name")

If (desiredName = "") Then
Exit Sub
End If

Sheets("My Template").Copy After:=ActiveSheet
ActiveSheet.Name = Left(desiredName, 31)
ActiveSheet.Range("Response") = ""
ActiveSheet.Range("NameCell") = desiredName

ActiveSheet.Visible = True
End Sub


Many Thanks!

Bura




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA crashes Excel

Bura,

I see no code to check for invalid characters in the sheet name.
[ ] : / \ * ? are not accepted by Excel in sheet names.
I don't know if entering these characters would crash Excel, but it sure
would cause problems.

Regards,

Jim Cone
San Francisco, CA
*******************
"Bura Tino" wrote in message
news:mAghb.74715$%h1.62162@sccrnsc02...
Hi,
The following seemingly innocent routines sometimes crashes excel with one
of those "Send Report" messages. This persists every time Excel is
restarted. Sometimes rebooting the machine helps.
"My Template" is a legitimate hidden worksheet.
Sub gNewSheet()
Dim desiredName As String
desiredName = InputBox("Enter the new portfolio name:", "Sheet Name")
If (desiredName = "") Then
Exit Sub
End If
Sheets("My Template").Copy After:=ActiveSheet
ActiveSheet.Name = Left(desiredName, 31)
ActiveSheet.Range("Response") = ""
ActiveSheet.Range("NameCell") = desiredName
ActiveSheet.Visible = True
End Sub
Many Thanks!
Bura



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default VBA crashes Excel

Thank you all for replying. Sorry for the delay. (I've had a proposal
due today and have been doing nothing but that.)

Yes, it is still a mystery. It doesn't crash every time. But sometime,
and this happens _all_ of our machines it starts crashing. It does it
consistently, for all sheet names, under all circumstances - until it
magically stops. I think a reboot helps. Next time it happens I'll
capture the stack and post it (I have no idea what it means...)

Thanks again.

Bura
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 crashes Matt Excel Discussion (Misc queries) 0 April 20th 07 07:52 PM
VBA excel crashes Jeff Excel Discussion (Misc queries) 0 November 3rd 06 03:43 PM
Excel 200 crashes Jeremy Ricketts Excel Discussion (Misc queries) 1 September 24th 06 07:49 PM
Excel XP Crashes Jeff Pines Excel Discussion (Misc queries) 6 February 14th 06 05:50 PM
Excel Crashes Hezingen Excel Discussion (Misc queries) 0 December 5th 05 03:47 PM


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