Sign In  Sign Up Live-Chat

Cannot update using array variables via Smart Markers in version 4.5.0.0

Last post 07-02-2008, 12:57 PM by BrightStar. 2 replies.
Sort Posts: Previous Next
  •  07-02-2008, 11:30 AM 134055

    Cannot update using array variables via Smart Markers in version 4.5.0.0

    Attachment: Present (inaccessible)

    It appears that version 4.5.0.0 does not allow me to update my spreadsheet using ARRAY variables (with Smart Markers).  Below is the exception I got:

    Unable to cast object of type 'System.Double[]' to type 'System.Object[]'.

    When I switch back to version 4.4.3.1 this problem goes away.  I am attaching my template spreadsheet.

    If you confirm this is a problem, please make a new release ASAP.  My project does not run anymore.  Thanks.

    I tested with this simple code:

    Module Module1
        Sub Main()
            Dim SP500(5), MSCI(5) As Double
            SP500(0) = 0.23
            SP500(1) = 0.24
            SP500(2) = 0.25
            SP500(3) = 0.26
            SP500(4) = 0.27
            MSCI(0) = 0.28
            MSCI(1) = 0.29
            MSCI(2) = 0.3
            MSCI(3) = 0.31
            MSCI(4) = 0.32

            Dim designer As Aspose.Cells.WorkbookDesigner = New Aspose.Cells.WorkbookDesigner()

            designer.Open("../../Test.xls")
            designer.SetDataSource("SP500", SP500)
            designer.SetDataSource("MSCI", MSCI)
            designer.Process()
            designer.Save("../../result.xls")
        End Sub
    End Module

     
  •  07-02-2008, 12:33 PM 134068 in reply to 134055

    Re: Cannot update using array variables via Smart Markers in version 4.5.0.0

    Hi,

    Please declare your array variables as Object type. i.e., 

    Dim SP500(5), MSCI(5) As Object... it will work fine.

    Thank you.

     


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  07-02-2008, 12:57 PM 134072 in reply to 134068

    Re: Cannot update using array variables via Smart Markers in version 4.5.0.0

    Yes, declaring it Object type does solve the problem.  Thanks very  much.
     
View as RSS news feed in XML