LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding a Name Crashes Excel

Hi! Whenever I call the "ActiveWorkbook.Names.Add" function, Excel
will simply panic, and quit altogether. This happens no matter what
the worksheet the name is directed to, or what the name or range
actually is (or if it already exists). The same goes for trying to
delete names.

However, this only happens when I run it from a worksheet function. If
I simply call it from the VBA editor, it works without issue.

Here is some example code that crashes things --

Public Function myStarNight(lookupStr As Variant) As String
Debug.Assert False
Dim hat As Variant
Set hat = ActiveWorkbook.Names.Add("Hi", "A1:A5")
Let myStarNight = "Hi!"
End Function

I insert this into a worksheet, and when I do that, the code simply
exits with no result. However, if I call it directly from VBA, it
works fine. Any insight?

 
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
adding a second axis crashes work of art - please help [email protected] Excel Programming 2 September 3rd 06 01:25 PM
Excel crashes when adding code using vbproject object? mikeb Excel Programming 5 May 8th 06 11:57 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
VBA crashes Excel Bura Tino Excel Programming 4 October 18th 03 09:01 AM


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