Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Error '1004'

Why does setting the RefersTo value cause a run-time error 1004 ?

Sub Macro_Change_Function()
'
' Macro_Change_Function Macro
'

'
If Sheet2.CheckBoxes("Check Box 23").Value = False Then
Sheet2.CheckBoxes("Check Box 23").Value = True
Else
Sheet2.CheckBoxes("Check Box 23").Value = True
End If

z = Sheets("Settings").Range("XLQ_Functions")
x = GetRefersTo("Fill_Formula")
a = SEARCHFORMULA(z, x)
b = ("xlqh") & Sheets("Settings").Range("Data_Type")
y = Application.Substitute(x, a, b)

ActiveWorkbook.Names("Fill_Formula").RefersTo = y


End Sub



- Ronald K.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Error '1004'

kittronald explained :
Why does setting the RefersTo value cause a run-time error 1004 ?

Sub Macro_Change_Function()
'
' Macro_Change_Function Macro
'

'
If Sheet2.CheckBoxes("Check Box 23").Value = False Then
Sheet2.CheckBoxes("Check Box 23").Value = True
Else
Sheet2.CheckBoxes("Check Box 23").Value = True
End If

z = Sheets("Settings").Range("XLQ_Functions")
x = GetRefersTo("Fill_Formula")
a = SEARCHFORMULA(z, x)
b = ("xlqh") & Sheets("Settings").Range("Data_Type")
y = Application.Substitute(x, a, b)

ActiveWorkbook.Names("Fill_Formula").RefersTo = y


End Sub



- Ronald K.


Debug.Print y to see what it is.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Error '1004'

Garry,

Just so everyone knows ... there's a 255 character limit for a name's
Refers to: value.

Of course, ... I already knew that. 8o


- Ronald K.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Error '1004'

on 10/11/2011, kittronald supposed :
Garry,

Just so everyone knows ... there's a 255 character limit for a name's
Refers to: value.

Of course, ... I already knew that. 8o


- Ronald K.


Yes, I know that! I've never tried (via code) to enter anything longer
so are you saying the length exceeded the limit and so the error?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Error '1004'

Garry,

That was the problem.



- Ronald K.


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
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Error 1004 opening workbook 1004 WembleyBear Excel Programming 2 November 30th 09 01:33 PM
Error when cell A1 is not active and xlInsideVertical border formatthrowing error 1004 [email protected] Excel Programming 7 August 7th 08 08:43 PM
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM


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