Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setNumberFormat in custom excel function

I have a custom C++ excel function. When the function's output is a
number, I want to format it with commas in 1000s and right justify in
the cell. I get return code 2 when I try using
success = XlfExcel::Instance().Call(xlcFormatNumber,0,1,xFor matNumber)
inside the custom function.
The same call work's fine in all other places except custom excel
functions.

Is there any workaround for this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default setNumberFormat in custom excel function

UDF's return values and that is it. They can not modify formats nor can they
change the values of cells that they are not in... When called from within
code they have free reign to do what they want, but not when called as a
function from a cell.
--
HTH...

Jim Thomlinson


"puni" wrote:

I have a custom C++ excel function. When the function's output is a
number, I want to format it with commas in 1000s and right justify in
the cell. I get return code 2 when I try using
success = XlfExcel::Instance().Call(xlcFormatNumber,0,1,xFor matNumber)
inside the custom function.
The same call work's fine in all other places except custom excel
functions.

Is there any workaround for this.

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
#VALUE! error with custom excel vba function Martin J. Excel Discussion (Misc queries) 8 October 6th 08 01:58 PM
recalculation of a custom function in excel Mark VII Excel Programming 4 September 18th 06 07:04 PM
Excel custom function dialog [email protected] Excel Worksheet Functions 0 February 16th 06 01:08 AM
Excel VBA -Custom function sumproduct ppp698 Excel Programming 1 August 20th 04 10:33 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


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