Cannot run the macro 'YIELD'. The macro may not be available in this workbook or all macros may be disabled.

Dear Sir,
          While i am calling Excel function through asp.net  using Excel 2003 i  was not facing any kind of issue it's working fine but while i am calling  Excel functions through asp.net using 
Excel 2010  i am facing an issue even after enabling the micro in settings . issue is 
"Cannot run the macro 'YIELD'. The macro may not be available in this workbook or all macros may be disabled." please solve this as soon as possible .
Thanks & Regards
  Sanjeev

// I made a singleton class and calling that class to access Excel functions
Public Class Singleton
    Private Shared objexcel As Excel.Application
    Private Shared lock As New Object
    Private Sub New()
        System.Console.WriteLine("Instance of Singleton class created at : " & Now())
    End Sub
    Public Shared Function GetInstance() As Excel.Application
        SyncLock lock
            If objexcel Is Nothing Then
                objexcel = New Excel.Application
                objexcel.RegisterXLL(objexcel.LibraryPath & "\Analysis\ANALYS32.XLL")
            End If
            Return objexcel
        End SyncLock
    End Function
End Class
// Common Function for yield 
Public Sub CalculateYield( _
           ByVal YTMDate As Date, ByVal FaceValue As Double, ByVal Rate As Double, _
           ByVal NonGovernmentFlag As Boolean, ByVal RateActualFlag As Boolean, _
           ByVal MaturityDate As Date, ByVal MaturityAmt As Double, _
           ByVal CouponDate As Date, ByVal CouponRate As Double, _
           ByVal CallDate As Date, ByVal CallAmt As Double, _
           ByVal PutDate As Date, ByVal PutAmt As Double, ByVal intFrequency As Int16, _
           ByVal strOption As String, ByVal dblResult As Double, ByVal strSemiAnnFlag As String)
        Try
            Dim decMarketValue As Double
            Dim intBasis As Int16
            decMarketValue = IIf(RateActualFlag = True, Rate * FaceValue / 100, Rate)
            decMarketValue = decMarketValue * 100 / FaceValue
            decMarketValue = objCommon.DecimalFormat(decMarketValue)
            MaturityAmt = MaturityAmt * 100 / FaceValue
            MaturityAmt = objCommon.DecimalFormat(MaturityAmt)
            CallAmt = CallAmt * 100 / FaceValue
            CallAmt = objCommon.DecimalFormat(CallAmt)
            PutAmt = PutAmt * 100 / FaceValue
            PutAmt = objCommon.DecimalFormat(PutAmt)
            intBasis = IIf(NonGovernmentFlag = True, 3, 4)
            If strOption = "Y" Then
                With Singleton.GetInstance
                    If MaturityDate <> Date.MinValue And MaturityDate > YTMDate Then
                        dblYield = CType(Singleton.GetInstance.Run("YIELD", YTMDate, MaturityDate, CouponRate / 100, decMarketValue, MaturityAmt,
intFrequency, intBasis), Double)
                        dblYTMAnn = CType(Singleton.GetInstance.Run("EFFECT", dblYield, intFrequency), Double)
                        dblYTMSemi = CType(Singleton.GetInstance.Run("NOMINAL", dblYTMAnn, 2), Double)
                        'End If
                        dblYTMAnn = dblYTMAnn * 100
                        dblYTMSemi = dblYTMSemi * 100
                    Else
                        dblYTMAnn = 0
                        dblYTMSemi = 0
                    End If
                    If CallDate <> Date.MinValue And CallDate > YTMDate Then
                        dblYield = CType(Singleton.GetInstance.Run("YIELD", YTMDate, MaturityDate, CouponRate / 100, decMarketValue, MaturityAmt,
intFrequency, intBasis), Double)
                        dblYTCAnn = CType(Singleton.GetInstance.Run("EFFECT", dblYield, intFrequency), Double)
                        dblYTCSemi = CType(Singleton.GetInstance.Run("NOMINAL", dblYTMAnn, 2), Double)
                        'End If
                        dblYTCAnn = dblYTCAnn * 100
                        dblYTCSemi = dblYTCSemi * 100
                    Else
                        dblYTCAnn = 0
                        dblYTCSemi = 0
                    End If
                    If PutDate <> Date.MinValue And PutDate > YTMDate Then
                        dblYield = CType(Singleton.GetInstance.Run("YIELD", YTMDate, MaturityDate, CouponRate / 100, decMarketValue, MaturityAmt,
intFrequency, intBasis), Double)
                        dblYTPAnn = CType(Singleton.GetInstance.Run("EFFECT", dblYield, intFrequency), Double)
                        dblYTPSemi = CType(Singleton.GetInstance.Run("NOMINAL", dblYTMAnn, 2), Double)
                        dblYTPAnn = dblYTPAnn * 100
                        dblYTPSemi = dblYTPSemi * 100
                    Else
                        dblYTPAnn = 0
                        dblYTPSemi = 0
                    End If
                End With
            End If
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
// call  yield function
GlobalFuns.CalculateYield(datYTM, decFaceValue, decRate, blnNonGovernment, blnRateActual, datMaturity, decMaturityAmt, _
                               datCoupon, decCouponRate, datCall, decCallAmt, datPut, decPutAmt, Val(Hid_Frequency.Value
& ""), "Y", 0, "")
this code  is working in Excel 2003 but it's not working in Excel 2010
//Error is
Cannot run the macro 'YIELD'. The macro may not be available in this workbook or all macros may be disabled.

Similar Messages

  • This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.

    Hey,
    I'm learning C#, using a book called "Learning C# by programming games". (2013)
    It comes with a zip file containing samples to use in Visual Studio.
    (I use Visual Studio Express 2013)
    However, opening the .CSPROJ files in the sample folder provided by the book's website results in the error mentioned in the title of this ticket.
    I would very much appreciate anyone taking the time to try and help me out.
    Thanks a bunch in advance,
    Erinn

    Hi Erinn,
    Could it have anything to do with the fact that the book uses XNA (and the sample projects were created with VS and XNA) and I use MonoGame with VS (since I my computer runs on windows 8,1)?
    Yes, that's definitely the problem (I don't know about writing games, but I Googled "MonoGame vs XNA"). First result returned by that search is informative (although it doesn't tell you how to get around the problem):
    http://stackoverflow.com/questions/21658493/is-monogame-just-xna
    I know that doesn't help you, but it tells you that it's a common issue and if no one here can help, maybe some more Googling might turn up something. Actually, after some more Googling, this looks useful:
    http://blogs.msdn.com/b/bobfamiliar/archive/2012/08/01/windows-8-xna-and-monogame-part-1-overview.aspx
    http://blogs.msdn.com/b/bobfamiliar/archive/2012/08/02/windows-8-xna-and-monogame-part-2-getting-started.aspx
    (UPDATE: especially Part 2, where he explains how to port XNA code to Windows 8 environment).
    ~~Bonnie DeWitt [C# MVP]
    http://geek-goddess-bonnie.blogspot.com

  • Sharepoint list dataheet view error "Cannot connect to the server at this time. You can continue working with this list, but some data may not be available"

    I have a List which is having around 14000 items in it.while opening that list in datasheet view it is giving error .
    Below is a summary of the issue:
    After selecting datasheet view beow error occurs:
        "Cannot connect to the server at this time.  You can continue working with this list, but some data may not be available."
        "Unable to retrieve all data."
        The item counts displays say 100 out of 14000 items.
    Exporting List to excel is giving only 2000 records out of 14000 records.
    Other Observations   -  
    This is happening to only one list on the site .There are other lists in the site whose no. of records is equal to 8000 to 9000.They are working absolutely fine without any error.
    Also, If I am saving this list as a template and creating another list with it ,then it is working absolutely fine with 14000 records,so the issue does not seem to be related with no. of records as the template list is working fine.
    I have checked the Alternate access mapping setting ,its fine.
    It should not be related to lookup,datefield or any other column as the list created from it template is working fine with all these columns.
    I checked below links also ,but doesn't seem to work in my case.
    http://social.technet.microsoft.com/forums/en-US/sharepointadminprevious/thread/974b9168-f548-409b-a7f9-a79b9fdd4c50/
    http://social.technet.microsoft.com/Forums/en-US/smallbusinessserver/thread/87077dd8-a329-48e8-b42d-d0a8bf87b082
    http://social.msdn.microsoft.com/Forums/en-US/sharepointgeneral/thread/dc757598-f670-4229-9f8a-07656346b9b0

    I have spent two days to resolve this issue. Microsoft has released two KBs with reference to this issue...but are not appearing in search results at the top.
    I am sharing my finding.
    1. First install the
    KB2552989 (Hopefully you might have already installed it. The KB detetcts it and informs the user.)
    2. Then update registry by adding new key for data fetch timeout as mentioned inKB2553007
    These two steps resolved the issue in our environment. Hope it might help others as well.
    Pradip T. ------------- MCTS(SharePoint 2010/Web)|MCPD(Web Development) https://www.mcpvirtualbusinesscard.com/VBCServer/paddytakate/profile

  • Itunes cannot run because some of the required files are missing?

    This morning when I turned on my computer my itunes was suddenly not working. When I double click the desktop icon to open it up, I get an error message that reads:
    iTunes cannot run because some of the required files are missing. Please reinstall iTunes.
    I searched the FAQ archive and still cannot find an answer to my problem.
    THe last part of the error message says to reinstall itunes, but I cannot even get the corrupt version off. Is there anyway to save the music I have on here? Another user and I have separate iTUnes music, so a great deal of music will be lost, including things recently purchased.

    Thank you so very much. I don't know why I didn't think of that but it is up and running fine now

  • Satellite M70-360: CEekey.eke cannot run because its missing the dll

    I accidentally removed the ekecioctl.dll and now everytime I start my laptop (Satellite M70-360) I get an error message saying that de CEekey.eke cannot run because its missing the dll. Does anyone know where can I download the dll?
    Thanks

    Hi
    The CEekey.exe seems to be a part of the Toshiba E-key utility.
    Therefore you should try to reinstall this Utility to get the keys working again.
    Another hint; did you try to restore the OS to the early time point?
    The XP supports an system restore tool. You can easily set the OS to a early point and the E-key should work again hopefully ;)

  • The Java load in database SID / hostname has not been configured yet. You cannot run an installation from the System Copy folder with this load

    Dear Gurus,
    We are facing the below issue when performing a homogeneous system copy of NW 7.0 system using backup/restore method for DB6 system.
    The Java load in database <SID>/<hostname> has not been configured yet. You cannot run an installation from the System Copy folder with this load.
    We went through the SAP Note http://service.sap.com/sap/support/notes/2049842, and followed the same but no luck.
    We updated the Kernel to the latest, but still no luck.
    Request for your quick help as we have to complete it by EOD today.
    Thanks a lot in advance.
    Best Regards,
    Anuj

    Hello Ashutosh ,
    Thanks for your reply.
    We have gone followed the below sequence:
    SCS Installation
    Database Instance Installation using backup/restore method
    CI installation. -> getting error, when we provide the Java Components DVD.
    Best Regards,
    Anuj

  • HT204476 I cannot open iPhoto now that I upgraded to Yosemite.When I click iPhoto it says I have to download older version of iPhoto.The app store, it says "The item you've requested is not currently available in the U.S. HELP!

    I upgraded my Macbook Pro (early 2011) to OS X Yosemite 10.10.3.  Now, I cannot open iPhoto. It says I have to download older version of iPhoto. When I go to the app store, it says: The version of iPhoto installed on this Mac is not compatible with OS X Yosemite. Download the latest version for free from the Mac App Store. the it says: "The item you've requested is not currently available in the U.S.Do I need to find my original Macbook disk and install it back and go from there? Did I loose all my pics?  Do I really ned it if they are all visible from the new "Photos" App? HELP!

    Try Terence's instructions here  Is Iphoto gone ? i want it back!
    Pete

  • Since I downloaded the upgraded software, my charger that came with my phone says "this cable or accessory is not certified and may not work reliably with this iphone"  It worked before but now it doesn't...I don't think I should have to buy a new one...

    since I upgraded to the new operating system my charger no longer works...
    It says"this cable or accessory is not certified and may not work reliably with this iPhone"

    Try checking your cable socket/lightning cable for dirt, grime, pocket lint, etc. I could not find the solution to this issue myself and after much searching I found someone stating that cleaning this out helped them immensely.
    After taking a wooden toothpick (making sure the phone was OFF first) and gently clearing out the edges and inside of the lightning socket this went away.) It is worth noting that I had a significant amount of dust or lint buildup along the edge rails which I think was causing the iphone to believe it was plugged into something when it was not.
    Try it and see, ensure you are very careful and do not use any conductive tools to clean the area in question. Compressed air also does wonders here.

  • When I try to sync my iPhone with my computer I get this message "This iPhone cannot be used because the Apple mobile device service is not started" What does this mean and how can I fix it?

    When I try to sync my iPhone 4S with my computer, I get this message: "This iPhone cannot be used because the Apple mobile device service is not started" What does this mean, and how can I fix it?

    means that apple mobile device service needs to be started try this article to get it turned back on
    Restart apple mobile device service

  • Just restored and updated my ipod and now when I connect it to my computer I get a message saying "this ipod cannot be used because the Apple Mobile Device service is not started" what does this mean?

    Just restored and updated my ipod and now when I connect it to my computer I get a message saying "this ipod cannot be used because the Apple Mobile Device service is not started" what does this mean?

    I'd start with the following document with that one:
    iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows

  • Adobe cant open the pdf it may be damaged or corrupted this happens for all pdf documents

    Adobe cant open the pdf it may be damaged or corrupted this happens for all pdf documents
    Steps to resolve
    Uninstalled and restarted the server
    Installed agan same error
    Uninstalled and restarted the server
    - Installed version 9.5
    - Same error

    Is this happening for brand new files downloaded from the internet?
    Or only for existing folders of PDFs on the server?
    Has the modification date changed on the PDFs?

  • Reoccurring warning, literally every 20 seconds: "This cable or accessory is not certified and may not work reliably with this iPhone." I am only using Apple devices. How can I eliminate the warning?

    Please help me eliminate this repeating warning message on my iPhone 5. It occurs several times a minute. I am only using Apple devices, so the warning is in error.  "This cable or accessory is not certified and may not work reliably with this iPhone."

    The cable may be damaged. Try another cable.
    Make sure it properly connected at both ends.

  • TS1368 My mac cannot connect with iTunes the message that appears is "the item you've requested is not  urgently available in the u.k store" although I am already connected to my u.k account

    My mac cannot connect with iTunes the message that appears is "the item you've requested is not  urgently available in the u.k store" although I am already connected to my u.k account

    well if it helps any, it's just not in the UK. We here across the pond are having the same error message. I'm so attempted to take this iPad back to the store. This is CRAAAAAAAZZZY

  • HT4095 2 Some movies may not be available from iTunes in the Cloud. These movies, if purchased in HD, will download both the HD and SD versions for you to sync to your compatible iPod and iOS devices. Previous purchases may be unavailable if they have bee

    2 Some movies may not be available from iTunes in the Cloud. These movies, if purchased in HD, will download both the HD and SD versions for you to sync to your compatible iPod and iOS devices. Previous purchases may be unavailable if they have been refunded or are no longer available in the iTunes Store, App Store, or iBookstore.

    Do you have a question ? Not all content is available for re-downloading e.g. if the content provider (or Apple) removes them from the store, and there are also some film studios (in countries where film re-downlaoding is possible) who haven't agreed to allow their films to be re-downloaded.
    Otherwise, re-downloading : http://support.apple.com/kb/HT2519

  • This iPad cannot be used as the Apple Mobile Device Service is not started.  Does this mean anything to anyone? How can I sync my iPad again?

    "This iPad cannot be used as the Apple Mobile Device Service is not started".  Does this mean anything to anyone? How can I sync my iPad again? Many thanks.

    In Windows 7, go to Control Panel, Adminisstrative Tools, Computer management, Services. In the servies box will be Apple Mobile Device (mine is 4th from top) click on this  and on the left side you can start service or right click the service and start from the drop down menu. I set mine to "delayed start" no issues since then.
    BPW

Maybe you are looking for