SmartView VBA Commands - HypCreateConnection and HypConnect

I am in the process of converting some spreadsheets with Essbase Excel add-in VBA macros to use the SmartView VBA functions. I am having trouble just doing the connect to the V11 database. Prior to the conversion I used the following command to connect to the database to access an Essbase version 6.5 database:
sts = EssVConnect("MS Essbase Actual", EssUsername, EssPassword, "Ws-bco-ess1", "Crsfo09", "Crsfo09")
I have migrated the database to Essbase version 11.1.1 (on another server) and am attempting to connect to it with the following command (Oracle Hyperion SmartView for Office, Fusion Edition):
sts = HypCreateConnection("MS Essbase Actual", EssUsername, EssPassword, HYP_ESSBASE, "http://ws-tst-esswl:13080/aps/SmartView", "Ws-tst-ess3d", "Crsfo09", "Crsfo09", "CrsConnection", "Analytic Services Provider")
This is failing with a status of -47. The User Guide for Oracle Hyperion SmartView for Office, Fusion Edition lists status codes up to -40. It appears to connect to Provider Services and bring up my Essbase servers, but not actually connect to a specific application/database.
I am using Excel 2007.
I am also confused about the difference between HypCreateConnection and HypConnect. Do you need to use both, and if so, in which order? I found an article about Customizing Smart View Worksheets by using the VBA Toolkit, but it makes no mention of HypCreateConnection (and instructions seem to be for Excel 2003), so it wasn't very helpful.
Thanks!

OK... I'm still struggling with this. I keep getting a -47 error on the HypCreateConnection line, which according to the docs says that the connection already exists. So I added commands to try to remove the connection prior to creating it if one already exists. Here is my code:
X = HypIsConnectedToAPS()
If X = True Then
X = HypDisconnectFromAPS()
End If
X = HypConnectionExists("SampBasicConn")
If X = True Then
X = HypRemoveConnection("SampBasicConn")
End If
X = HypCreateConnection(Empty, "admin", "password", HYP_ESSBASE, "http://apsserver:13080/smartview/SmartView", "essserver", "Sample", "Basic", "SampBasicConn", "Analytic Provider Services")
X = HypConnectionExists("SampBasicConn")
If X = True Then
X = HypConnect(Empty, "admin", "password", "SampBasicConn")
End If
Return codes are all expected (sometimes I have to disconnect from APS and sometimes not) until I hit the HypCreateConnection line. The HypConnectionExists always returns false, but HypCreateConnection returns -47. After that, I test for the connection again, and it returns false. So why am I getting a -47? Also, there is no connection. It is truly acting as though the HypCreateConnection is failing. But the error code is not helpful. Is there any way to tell what is causing the failure? It seems I have tried all permutations of "/aps/SmartView", "/smartview/SmartView", fully qualified server names, etc. Is there a way to tell what is causing the failure (bad username/password, bad APS URL, bad Essbase server, bad application/database, etc.)?

Similar Messages

  • Smartview VBA - Using HypCreateConnection to connect to different Providers

    Hello,
    I am currently working with Smartview 11.1.1.3.500. I am trying to build some code that will allow me to switch between our production and test environments that are on different APS URLs, rather than having to go into the options and typing in the server information everytime I need to switch. It looks like the HypCreateConnection function would be the one that would allow me to do this, but I'm not sure if I'm using it correctly. I am trying to send the Prod or Test APS URL and database info into the vtProviderURL and vtServerName parameters.
    HypCreateConnection(Empty, [userName], [userPass], HYP_ESSBASE, [Prod/Test APS URL], [Prod/Test Server Info], [AppName],[DB Name], [Prod/Test Name] , "Analytic Provider Services")
    However it seems that despite passing the URL to the function, the connection is using the information that is saved in the "Default URL" box in the "Hyperion Provider Service URL" section, in the "Ad Hoc" tab of the Hyperion Options window, which is where I've been manually typing in the Prod or Test URL everytime I need to retrieve their respective data.
    The result is that after running my code, the "Smart View Data Source Manager" indicates that the APS URL being connected to is what was saved in my options, rather than my code.
    Any help would be appreciated
    Edited by: 1002778 on Apr 26, 2013 9:11 AM
    I just realized that this is should be in the Smart View forum. Admins, feel free to move this thread.
    Edited by: 1002778 on Apr 26, 2013 1:21 PM

    I tried creating a connection and connecting and it is working for me. This is the macro that i used.
    Sub create_connect()
    sts = HypCreateConnection("Sheet2", "username", "password", HYP_ESSBASE, "http://testservername:19000/aps/APS", "testessbase", "app", "db", "App:DB", "Test Cube1")
    sts = HypConnect(Empty, "username", "password", "App:DB")
    End SubRegards
    Celvin

  • SmartView VBA code to connect to Essbase

    Hi,
    I am trying to connect to Essbase v 11.1.13 via Smartview v 11 using Macro (VBA code). Thing is that I am able to make connection, but not able to autneticate after connecting to Appname and Dbname in that server. In right hand side after this macro is run, I need to manually click on the server and then go ahead to that appname and Dbname and then do adhoc analysis.
    Any inputs how to proceed with this step using SmartView VBA code?
    The code I am using is -
    bIsConnection = HypIsConnectedToAPS()
    If bIsConnection = True Then
    bIsConnection = HypDisconnectFromAPS()
    End If
    bIsConnection = HypConnectionExists("Sampleconn")
    If bIsConnection = True Then
    bIsConnection = HypRemoveConnection("Sampleconn")
    End If
    X = HypCreateConnection(Sheet1, User, pwd, "HYP_ESSBASE", url, sServer, app, db, connectionname, "Analytic Provider Services")
    X = HypConnect(Empty, User, pwd, connectionname)
    Please let me know even after this code, why it is not selecting appname.dbname in Smart view Data source manager?

    In the code below there is no existing connection called “My DMDemo Basic”. So using HypCreateConnection, this connection is created which connects automatically to the application database using username and password as per the sample code.
    If the connection string already exists, then you can call HypConnect to connect.
    The HypCreateConnection does not really need a valid username and password. But when we are using HypConnect, it validates the username and password and recognizes with the friendly name per the connection name - for example "My DMDemo Basic".
    If you want the user to be prompted for login details instead o f hardcoding the values, then you can assign null values to them - username and password as null values which is - "" (note this is open and close double quotes without any space). This will bring up the window where you can give the username and password values.
    Run the following code by opening a brand new Excel file and then copying the code below into the Visual Basic Editor Module. Make sure you modify all the parameters according to your setup including username, password, server name, application name, etc.
    Private Declare Function HypConnect Lib "HsAddin.dll" (ByVal vtSheetName As Variant, ByVal vtUserName As Variant, ByVal vtPassword As Variant, ByVal vtFriendlyName As Variant) As Long
    Private Declare Function HypCreateConnection Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtUserName As Variant, ByVal vtPassword As Variant, ByVal vtProvider As Variant, ByVal vtProviderURL As Variant, ByVal vtServerName As Variant, ByVal vtApplicationName As Variant, ByVal vtDatabase As Variant, ByVal vtFriendlyName As Variant, ByVal vtDescription As Variant) As Long
    Sub Conn()
    Dim username As Variant
    Dim password As Variant
    Dim x As Variant
    Dim HYP_ESSBASE As Variant
    HYP_ESSBASE = "ESSBASE"
    username = "admin"
    password = "password"
    x = HypCreateConnection(Empty, username, password, HYP_ESSBASE, "http://localhost:13080/aps/SmartView", "localhost", "DMDemo", "Basic", "My DMDemo Basic", "Analytic Provider Services")
    MsgBox x
    x = HypConnect(Empty, username, password, "My DMDemo Basic")
    MsgBox x
    End Sub
    HTH-
    Jasmine

  • SmartView VBA - Cannot set "Update Column Width" setting

    Hi Folks,
    I'm in the process of updating a series of v9 Essbase VBA API-driven workbooks to SmartView 11.1.2.1 and have hit a problem - I'm new to the SV VBA commands, and I'm hoping this is something obvious that I'm missing.
    One of the functions that is key to ensuring data retrieval does not change the layout of the spreadsheets is the "Adjust Column Widths" setting, which in the Essbase VBA API could be managed using the EssVSetSheetOption function, but neither HypSetGlobalOption nor HypSetSheetOption appear to have any such capability. The only option I'm left with is to run retrieves followed by some reformatting of column widths, which seems rather ineligant to me.
    Any ideas?
    Many thanks,
    Dave

    looking in the .bas file (and what should be included in your project I find HSV_ADJUSTCOLUMNWIDTH in the definitions for Enumeration of options index to be used for HypGetOption/HypSetOption
    Note, I'm looking at the 11.1.2.2 version, your mileage may vary depending on your version

  • Problems with the vba command sendkeys in Access 2013.

    Hi, I have problems with the vba command sendkeys in Access 2013.
    I use a text field (no control) in a form. By means of the VBA command SendKeys "+ {DELETE}", 1  I get the text in memory from the text field, then place (paste) the text in a Word document. The command line sendkeys
    is followed by moving the focus to a particular control. In Access 2003, which went smoothly. Now the sendkeys command is executed only in Access 2013 in the control that then receives focus. If the procedure ends with the sendkeys command then it works well.
    The procedure with the sendkeys command is activated by a button on a form.
    Who can help me?
    private user

    Hi H.Plmp,
    Based on the description, you want to call the sendkeys from a button.
    >> use a text field (no control) in a form. By means of the VBA command SendKeys "+ {DELETE}", 1  I get the text in memory from the text field<<
    What did you mean that you no control? And how did you get the text in memory from the text field? Also I am not able to understand the exact reason that the command doesn't works in Access 2013.
    And based on the test, sendkeys "+ {Delete}" works well for me when I set a focus for the textbox control. Here is th test code:
    Me.Controls("txtField1").SetFocus
    SendKeys "+ {DELETE}", 1
    If I misunderstood, please feel free to let me know.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • VBA command changed in Excel 2010?

    We recently upgraded to Excel 2010, and a macro that always worked perfectly in 2007 is behaving strangely now.
    I use the following command to insert a picture into Microsoft Excel:
    Set pic = ActiveSheet.Pictures.Insert("C:\Pictures\Example.tif")
    (Sorry for not inserting the above in a code block, but my web browser kept timing out while waiting for it.)
    That VBA command used to work flawlessly, but ever since I upgraded to Office 2010 and email my new workbook with a picture added via a macro to anybody else
    on site, the picture is gone with this error message in its place:
    "The linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verify that the link points to the correct file and location."
    What changed in Excel 2010 to cause my VBA script to insert a LINK to a picture instead of embedding the actual picture?  Does anybody with a similar
    macro have this problem?

    Hey G North,
    I had added a workaround to my code, but your one (1) line offers a better solution. 
    And you're right . . . my original code did include the top, left, height, and width parameters, and this was the workaround I came up with:
    Dim pic As Picture, rng As Range
    Set pic = ActiveSheet.Pictures.Insert("C:\Pictures\Example.tif")
    Set rng = ActiveWindow.RangeSelection
    With pic
    .Top = ActiveCell.Top
    .Left = ActiveCell.Left
    .ShapeRange.LockAspectRatio = msoFalse
    Resize the picture's Height and Width
    to match the Current Range.
    .ShapeRange.Height = rng.RowHeight
    .ShapeRange.Width = rng.Width
    .Placement = xlMoveAndSize
    .Cut
    End With
    ActiveSheet.Pictures.Paste.Select
    You'll notice that after I inserted my picture and resized it to fit the active range, I CUT it and then PASTED it in that same range as a PICTURE.
    But again, your single line of code is preferable.
    Thanks again!

  • Smartview VBA function for launch calc-scripts as strings. like EsbCalc ???

    We have used an Excel VBA which launch an calculation script from a STRING using the VBA Add-In function "EsbCalc".
    We would like to migrate to Smartview VBA functions.....
    The calc-script string has "parameters" which are modified at run-time...
    I have found the function HypExecuteCalcScript - but seems that use as parameters ONLY the calc-script name...
    Is it any VBA function in SmartView which launch a calc-script string (not a calc-script name) ?
    We are using EPM 11.2
    Thanks...

    A tip I just learned at Kaleidoscope 2010* is that one can create a calc script consisting entirely of a substitution variable. In other words, a calc script can look like this:
    &Calc
    Smart View VBA does have a function for changing or creating substitution variables (HypSetSubstitutionVariable). You could create a calc script and subvar in your database as above. Then, at run time, set that subvar to your calc string with HypSetSubstitutionVariable and execute the calc script with HypExecuteCalcScript.
    Quick test (11.1.1.3) shows that this really works.
    I can't remember privileges required to create or set subvars vs execute calc strings off the top of my head - might be an issue (I ran as an admin). Also this approach doesn't support concurrent users, unless they each have a calc script and subvar to themselves. Still, depending on your exact situation, this might be a feasible workaround.
    *I won't credit the presenter solely because the tip came from a presentation which he specifically declined to make public domain.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Essbase Smartview VBA macros error

    I have a Essbase Smartview VBA macros issue as below:
    I want get a value that I choose in POV dynamic dropdown list.
    And show the value in the excel.
    For example:
    There customer dimention -childs are IBM、ACR show in POV dynamic dropdown list.
    I choose IBM in POV then in excel sheet A1 show IBM.
    I try the below vba code:
    Private Sub CommandButton2_Click()
    Dim vtGrid As Variant
    Dim vtDimNames As Variant
    Dim vtPOVNames As Variant
    X = HypRetrieve("Sheet1")
    If X = 0 Then
    MsgBox ("Retrieve successful.")
    Else
    MsgBox ("Retrieve failed.")
    End If
    Range("F1").Select
    Sts = HypGetSourceGrid("Sheet1", vtGrid)
    Y = HypGetPOVItems(vtDimNames, vtPOVNames)
    Range("h1").Value = Y
    End Sub
    '==========================================
    But Y result is -3.
    How did I get the value in dynamic dropdown list.
    Thanks~

    Few comments:
    1. Range("F1").Select: Is F1 inside the grid you are rerieving? If you do a fresh retrieve Range("B2").Select is a better location and you will not get -3.
    2. Range("h1").Value = Y. You are setting the error message and not the POV member name. vtPOVNames is an array of POV members and you should use Range("h1").Value =vtPOVNames(1) to get the member name. (1) being the first dimension in the POV.
    3. Word of caution. You will not be able to put a valid member name in the grid if it already exists in the POV. I recommend you preface the member name by any string that will make it unique. For instance, you could use
    Range("h1").Value = vtDimNames(1) & ": " &vtPOVNames(1)
    This way you will see the DimensionName: Member Name.
    Here is the modified code:
    Sub test()
    Dim vtGrid As Variant
    Dim vtDimNames As Variant
    Dim vtPOVNames As Variant
    X = HypRetrieve("Sheet1")
    If X = 0 Then
    MsgBox ("Retrieve successful.")
    Else
    MsgBox ("Retrieve failed.")
    End If
    Range("b2").Select
    sts = HypGetSourceGrid("Sheet1", vtGrid)
    Y = HypGetPOVItems(vtDimNames, vtPOVNames)
    Range("h1").Value = vtDimNames(1) & ": " & vtPOVNames(1)
    End Sub
    Edited by: Toufic Wakim on May 3, 2010 11:54 AM

  • How can i install snow leopard on my mac G5 using a command line and booting from an external usb rom, since my disk i have is not a bootable media

    How can i install snow leopard on my mac G5 using a command line and booting from an external usb rom, since my disk i have is not a bootable media

    Hi.
    You simply can't. Snow Leopard is compiled in Intel binary only.
    Good Luck.

  • How do i access my installer disc on a 2011 macbook pro as they are virtual now, i have tried to use command r and hold shift on start up

    I have, a 2011 macbook pro with osx lion, last year  it died, by doing the not getting past the logo and startup gear, i tried doing the data screen repair where u type some code and try and repair, that didnt work so i took it to genius bar and it wasnt in warrenty and they were gonna charge me but as was only 3 weeks over the warrenty period, so they did for free, and the harddrive they installed had a 90 day warrenty and that is ova now, and my mac has now done the same thing again and this time i think was a power interruption at some point and now has a fault, another thing that crossed my mind is that yes this has done this but could they have (to save money and not right offf a new one) given me my same harddrive back and jus wiped it now 5 months down the track its broken again?
    The laptop isnt even 18 months old and has broken down twice, my old macbook had 4 5 years not a hiccup.
    In conclusion i need to get photoes off it and cant seem to activate safe mode, or do i know how to access the startup disk that the guy did at genius last time, or get to the data screeen that allowed me to attempt to repair the drive. Can someone help me please, i have tried command r and holding shift, meither have worked.

    It's hard to know whether your hard drive has actually failed or if your system has just gotten badly corrupt. If the former, unfortunately, there may be no way to get any data off the drive at this point. If there aren't any backups of that data, it will be gone forever, unless perhaps a high-priced (ie, in the thousand dollar range) data recovery service has some luck with it.
    If the system and/or hard drive are badly corrupt, the same may be true. Some or all of that data may be irrevocably corrupt by now. However, there are some ways that you can attempt to recover from this situation without paying such huge fees. First, if you have access to another Mac, and both have Firewire ports, you can connect the two using Firewire target disk mode. This will mount the damaged drive as if it were an external hard drive on the second Mac, and could allow you to copy some data from the drive.
    Another possibility would be to buy an external hard drive, install Mac OS X on it and boot the machine from that, then copy any data from there that you can.
    In both of these cases, it may be helpful to scan the damaged drive for recoverable files using something like Data Rescue.
    There are also some possible ways to repair the drive if you can't do either of those things, but any repairs at this point could potentially destroy data. I only recommend this as a last resort. Still, if all other options have failed, try repairing the drive using DiskWarrior. This can fix problems that Disk Utility (and fsck, the command-line tool that it sounds like you may have used) cannot. It is possible that DiskWarrior will be able to get the drive back in working order long enough to get the data recovered, though of course it's also possible the process will be destructive.
    If none of the above work, you'll have to seek professional help.

  • I can no longer use the keyboard shortcuts, 'command  C' and 'command   V'.  Did I inadvertently do something to my keyboard or computer that caused this?  Is there a way to fix it?

    I can no longer use the keyboard shortcuts, 'command  C' and 'command   V'.  Did I inadvertently do something to my keyboard or computer that caused this?  Is there a way to fix it?

    You can also check in System Preferences > Keyboard > Keyboard Shortcuts, make sure that custom shortcuts were not created using those same commands. If ones were, they could be creating a conflict. Step throuogh each of the items in the left list, checking the array presented in the right pane for each.

  • Command, Control, and Option keys no longer works with Citrix Receiver after upgrading to OSX 10.9.5

    At first my keyboard did not work with Citrix Receiver after upgrading to OSX 10.9.5 and I found the workaround by using "cmd + tab," however, once my keyboard work within Citrix, the "command, control, and option" keys no longer work.  Does anyone have a remedy for this?

    Keyboard no longer works with Citrix Receiver after upgrading to OSX 10.9.5

  • How can we write the code for opening the command prompt and closing the

    how can we write the code in java for opening the command prompt and closing the cmd prompt from eclipse (cmd prompt should close when click on the turminate button in eclipse)

    rakeshsikha wrote:
    how can we write the code for opening the command prompt and closing theBy typing in Eclipse (which you seemingly have)?

  • Open a command window and send some keystroke to the opened command window

    Hi All,
    I am trying to open command prompt and send some key stroke to that command prompt. Here I am using Robot to send keystroke. But the problem is, the keystrokes are not sent to the prompt. I guess I need to activate progamitically the command prompt to accept the keystrokes . Please find the code below ( as I did).
    try
    String command = "cmd.exe /c start";
    Process child = Runtime.getRuntime().exec(command);
    Robot robot = new Robot();
    Thread.sleep(5000);
    String lol = "indranil";
    for(int i=0;i<lol.length();i++)
    robot.keyPress(lol.charAt(i));
    int g = lol.length() - 1;
    robot.keyRelease(lol.charAt(g));
    catch (Exception e) {}
    I guess I am doing some mistake here while sending the keystroke/openning the command prompt. Can anyone please help me how can I open a command window and send some keystroke to the opened command window. I am in fix.
    Thanks,
    Indranil

    The first thing to do is read the API and examples for the Robot class.
    Also check out this thread with a similar discussion: [http://forums.sun.com/thread.jspa?threadID=5385677]
    The short spoonfed answer - keyPress() and keyReleaseI() do not take chars. Read up on KeyEvent

  • I am trying to connect my iMac with my MacBook What is the command keys and process in doing so. Have firmwre in place.

    I am trying to connect my iMac with my MacBook What is the command keys and process in doing so. Have firmwre in place.

    Here's the Apple Support article on Target Mode http://support.apple.com/kb/HT1661

Maybe you are looking for

  • Aging Reports

    Hi all,    can you guys tell me what are aging report, why are they called so gimme a brief overview Thanks Due points will be assigned

  • Time Base / Carry Forward / Copy Last years balances

    Hi Experts, Can anyone throw light on how would the TIME=BASE function as used in the script below help in carry forward ? Is the below syntax correct ? *XDIM_MEMBERSET DATASRC=%MyDataSrc% *XDIM_MEMBERSET TIME=BASE,%TIME_SET% *XDIM_MEMBER ACCTDETAIL=

  • How to use a checkbox to toggle visibility of a Bar or Line on a Graph

    I came across a tutorial but can't seem to get it working properly.  Would someone be able to better explain how you can use checkboxes on/off to toggle the visibility of a line or bar on a graph?  I know you can do this directly within the graph's l

  • When to NEVER attribute of transactions in ejb

    Hi all Can any one tell me when to use NEVER . Plz tell me the sinaroo that we will use it. Thq

  • Firefox-QT

    There is one firefox-qt package in AUR, but it is very old. Now Firefox-QT is in Master branch, to compile it you must set "--enable-default-toolkit=cairo-qt" to configure. Ive tried making pkgbuild but got error when compiling: gfxQPainterSurface.cp