Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Help: UDF Used in Conditional Format not Initialized

I am using a simple UDF in a module:

Option Explicit
Function GetFormula(Cell As Range) As String
GetFormula = Cell.Formula
End Function

This UDF is only used in a conditional format to let me know if someone has
replaced the default formula in a cell with a hardcoded value.

When I open the workbook, Excel seems to forget to initialize the UDF and
the formats are not shown. If I open the module and make a change to the
code or use the function regularly in a cell then suddenly all the
conditional formats start working.

Any thoughts on how to make this more robust so it works as soon as I open
the workbook?

Thanks in advance,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help: UDF Used in Conditional Format not Initialized

Maybe...

Add

application.calculate

to your auto_open/workbook_open code?

Dan wrote:

I am using a simple UDF in a module:

Option Explicit
Function GetFormula(Cell As Range) As String
GetFormula = Cell.Formula
End Function

This UDF is only used in a conditional format to let me know if someone has
replaced the default formula in a cell with a hardcoded value.

When I open the workbook, Excel seems to forget to initialize the UDF and
the formats are not shown. If I open the module and make a change to the
code or use the function regularly in a cell then suddenly all the
conditional formats start working.

Any thoughts on how to make this more robust so it works as soon as I open
the workbook?

Thanks in advance,


--

Dave Peterson
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
how to check that a var type date is initialized ?? François Excel Programming 3 July 16th 05 07:15 PM
Userform runs other subs when initialized zipdog Excel Programming 3 February 2nd 05 04:04 PM
Listbox initialized on workbook load Kandi Excel Programming 5 December 21st 04 05:19 PM
ImageList must be initialized What-a-Tool Excel Programming 6 October 27th 04 12:39 AM
listbox value not initialized John Holland Excel Programming 2 November 25th 03 07:57 PM


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