If you must dynamically retrieve the variable descriptions from SAPListOfVariables, you could pass each variable description retrieved from SAPListOfVariables to SAPGetVariable using TECHNICALNAME as the 3rd parameter, in order to resolve the technical name from the description. In the meantime, you can design your query to have unique variable descriptions and/or hard-code the technical names into your spreadsheet/VBA. Vote for the enhancement, and we might get it in a future release. This has been raised as an Idea on Idea Place. There is a problem here if you inadvertantly end up with 2 variables that have the same description, as you can't (with this function alone) reliably determine which variable you're retrieving the value for. The 2nd parameter determines whether the Text or the Key is returned for the Value in the variable. You're right that the SAPListOfVariables only returns the Variable descriptions.
Hello Martin, and thanks for your feedback. For example, requesting DIMENSION details with SAPGetCellInfo, on a data cell, would not return any data because data cells do not have DIMENSION details.įound any other Error values while using the add-in? Add them in the comments… The add-in returns this when you’ve requested data that doesn’t exist. It indicates that the add-in is either not loaded, or that the function you’re calling isn’t registered (you might encounter this if you’re trying to call a function that is only present in a newer version of the add-in than you’re currently using, or if a function in the current version is removed in a future version of the Add-In)Ģ042 – #N/A – This is the error value that you’ll probably encounter most frequently with the Analysis add-in. The user should have been presented with an Exception dialog, with an option to Restart the session, so if you encounter this error in your code, you’ll need to handle a Restart.Ģ029 – #NAME! – This error isn’t actually returned by the Add-In, but instead by Excel. In other words, the datasource is not connected, and the function can’t return a value. There is a subtle difference between returning “no data to return” as Error 2015, and returning “non-existant data” as Error 2042.Ģ023 – #REF! – This error indicates that the datasource hasn’t been successfully refreshed, or has encountered an Exception. Note the difference between this error and Error 2042 below. It’s not really an error that indicates that the cell doesn’t have a selection, or that an error occurred with your syntax or arguments, but it is an indicator that the cell’s SELECTION dimensions actually include all row and column dimensions. For example, calling SAPGetCellInfo (to discover a cell’s SELECTION) on a cell that is a total across all dimensions, will not return any dimensions in the array, and instead return Error 2015. When calling a function that you might expect to return an array, but there aren’t any values in the array. For example, calling SAPGetMember with a non-existent Dimension/Member pair as the second argument, will not return an error, but instead, just a zero-length string.Ģ. Note however, that the Add-In only treats certain invalid arguments as errors.
For example, if you call a function that expects a Data Source Alias, and you provide an Alias that doesn’t exist in the workbook, the function will return Error 2015. When calling a function and providing invalid arguments to the function. Of the errors above, the Analysis add-in returns the errors below, but the occurrence rules sometimes differ slightly….Ģ015 – #VALUE! – This error is returned in at least 2 situations:ġ. I’m only detailing the errors that I’ve seen produced by the add-in (as at 1.4 SP3.1 and in Excel 2007), so if you know of any more, please add details in the comments…Įxcel has a number of built in errors, as follows:Ģ000 #NULL! Two range areas do not intersect.Ģ007 #DIV/0! A number is divided by zero.Ģ015 #VALUE! Incorrect type of argument or operand is used.Ģ029 #NAME? Excel doesn’t recognize text in the formulaĢ036 #NUM! Invalid numeric values in a formula/function.Ģ042 #N/A A value isn’t available to a function/formula. This article is about VBA/Excel errors only, and not the Add-In error codes that can be retrieved using SAPGetProperty and “LastError”. Every solution is different, so I won’t try to explain how you should handle these error values in your solution, but instead, I’ll just list and explain the error values that you’ll probably encounter.
For a robust Excel or VBA solution, you”ll need to know what each of these errors are, when they might occur, and how to handle them.
The Analysis Add-In functions can return several error values.