Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > VB 2008 - Complementary Error Function?
 

VB 2008 - Complementary Error Function?

Hello,

I'm a novice at VB and I need to calculate a complementary error function as part of a model I am programming. In Excel 2007, the function is ERFC() however I can find no such function in VB. Is there a straight forward way of adding this function (or calling up Excel to calculate it from VB)?

Thanks in advance,

Jon
Munnjo  Tuesday, November 24, 2009 2:50 PM
Hi Munnjo,

Yes you can use excel function in vb.net. You need to add reference to Microsoft.Office.Interop.Excel first.
Then you can use it like this
Imports Microsoft.Office.Interop.Excel

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim excelApp As Application
        excelApp = CreateObject("Excel.Application")
        excelApp.WorksheetFunction.ErfC(parameter)

    End Sub
End Class
Besides, you can get better response at VBA forum

Regards
Jeff Shan

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Marked As Answer byMunnjo Thursday, November 26, 2009 3:13 PM
  •  
Jeff Shan  Thursday, November 26, 2009 9:25 AM
Hi Munnjo,

Yes you can use excel function in vb.net. You need to add reference to Microsoft.Office.Interop.Excel first.
Then you can use it like this
Imports Microsoft.Office.Interop.Excel

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim excelApp As Application
        excelApp = CreateObject("Excel.Application")
        excelApp.WorksheetFunction.ErfC(parameter)

    End Sub
End Class
Besides, you can get better response at VBA forum

Regards
Jeff Shan

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Marked As Answer byMunnjo Thursday, November 26, 2009 3:13 PM
  •  
Jeff Shan  Thursday, November 26, 2009 9:25 AM
Thank you so much Jeff! You're a life saver.

Cheers


Munnjo  Thursday, November 26, 2009 3:14 PM

You can use google to search for other answers

Custom Search

More Threads

• UniqueID Bug???
• I Create My Own Class For Every Class Returned From A Service
• Is there a way to get the visualisation from windows media player
• Keyboard events
• Alpha Blending Performance
• Newbie: How do I declare a Global or Public Variable?
• Connecting to a server
• webbrowser documentcompleted
• Checking User Group in Active Directory using VB.net
• Currency TextBox