Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default #VALUE! error with custom excel vba function

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default #VALUE! error with custom excel vba function

No idea?

"Martin J." wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default #VALUE! error with custom excel vba function

I'd guess that there was something wrong in the code you didn't share.

Martin J. wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default #VALUE! error with custom excel vba function

Thanks for the advice.
This is what I thought as well, but even if I set the inside of the function
to this only line:
GetSmokePower = 3
I get the same error...

Any idea?

Thanks by advance,
Martin

"Dave Peterson" wrote:

I'd guess that there was something wrong in the code you didn't share.

Martin J. wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default #VALUE! error with custom excel vba function

Do you have any unhandled errors in any other UDF?



Martin J. wrote:

Thanks for the advice.
This is what I thought as well, but even if I set the inside of the function
to this only line:
GetSmokePower = 3
I get the same error...

Any idea?

Thanks by advance,
Martin

"Dave Peterson" wrote:

I'd guess that there was something wrong in the code you didn't share.

Martin J. wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default #VALUE! error with custom excel vba function

I don't have any other UDF atm.

"Dave Peterson" wrote:

Do you have any unhandled errors in any other UDF?



Martin J. wrote:

Thanks for the advice.
This is what I thought as well, but even if I set the inside of the function
to this only line:
GetSmokePower = 3
I get the same error...

Any idea?

Thanks by advance,
Martin

"Dave Peterson" wrote:

I'd guess that there was something wrong in the code you didn't share.

Martin J. wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default #VALUE! error with custom excel vba function

You abbreviated code worked fine in my tests.

I don't have another guess.

Martin J. wrote:

I don't have any other UDF atm.

"Dave Peterson" wrote:

Do you have any unhandled errors in any other UDF?



Martin J. wrote:

Thanks for the advice.
This is what I thought as well, but even if I set the inside of the function
to this only line:
GetSmokePower = 3
I get the same error...

Any idea?

Thanks by advance,
Martin

"Dave Peterson" wrote:

I'd guess that there was something wrong in the code you didn't share.

Martin J. wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default #VALUE! error with custom excel vba function

I finally found my error, a bit silly.
I wrote a ',' instead of a ';' between the two arguments in the call of the
function. Being used to other programming languages as java or c/c++, I
obviously did not notice that difference.
Btw, thanks a lot for trying helping me,

Have a nice day,
Martin

"Dave Peterson" wrote:

You abbreviated code worked fine in my tests.

I don't have another guess.

Martin J. wrote:

I don't have any other UDF atm.

"Dave Peterson" wrote:

Do you have any unhandled errors in any other UDF?



Martin J. wrote:

Thanks for the advice.
This is what I thought as well, but even if I set the inside of the function
to this only line:
GetSmokePower = 3
I get the same error...

Any idea?

Thanks by advance,
Martin

"Dave Peterson" wrote:

I'd guess that there was something wrong in the code you didn't share.

Martin J. wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default #VALUE! error with custom excel vba function

That separator string is a windows setting.

For me (and my USA settings), the separator is a comma.

Not for you!

Glad you found it and thanks for posting back.

Martin J. wrote:

I finally found my error, a bit silly.
I wrote a ',' instead of a ';' between the two arguments in the call of the
function. Being used to other programming languages as java or c/c++, I
obviously did not notice that difference.
Btw, thanks a lot for trying helping me,

Have a nice day,
Martin

"Dave Peterson" wrote:

You abbreviated code worked fine in my tests.

I don't have another guess.

Martin J. wrote:

I don't have any other UDF atm.

"Dave Peterson" wrote:

Do you have any unhandled errors in any other UDF?



Martin J. wrote:

Thanks for the advice.
This is what I thought as well, but even if I set the inside of the function
to this only line:
GetSmokePower = 3
I get the same error...

Any idea?

Thanks by advance,
Martin

"Dave Peterson" wrote:

I'd guess that there was something wrong in the code you didn't share.

Martin J. wrote:

Hi everybody,

I get a #VALUE! error when using a custom function. Here is the code of the
function (in a VBA module):

Function GetSmokePower(PlantType As Integer, FuelType As Integer)
...
...
GetSmokePower = Vswe
End Function

I just call this function that way in excel:
=GetSmokePower(3,1)

Did I do something wrong? Do I have to set some options on or off?

Thanks a lot for helping me,
Regards,

Martin J.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

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
Excel 2007 - Custom error bars ?? mc.linux Charts and Charting in Excel 5 September 6th 08 10:36 PM
Excel Custom Sort Error [email protected] Excel Discussion (Misc queries) 0 January 9th 08 05:10 PM
cUSTOM error Bars in Excel 2007 RM2007 Excel Discussion (Misc queries) 0 June 20th 07 09:17 AM
Custom Error Bar for Excel 2007 zrepiV Excel Discussion (Misc queries) 0 June 21st 06 06:07 AM
Custom function returning VALUE error alex.k Excel Discussion (Misc queries) 6 September 27th 05 03:05 AM


All times are GMT +1. The time now is 01:21 PM.

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"