Disconnect all active Essbase connections using VBA code in Excel

Hi All,
I am currently using the below code to disconnect the active essbase connection. It works fine but it shows me a windows with the list of active essbase connections and I have to select each essbase connection and click disconnect. I want a vba code which will disconnect / kill all active connections of Essbase at one go. for e.g. I have 10 worksheets connected to different databases in Essbase. I want a code which will disconnect all 10 sheets at one go. Please expedite. Thanks for your help in advance.
Private Sub MDisConn()
On Error Resume Next
EssError = EssMenuVDisconnect()
ErrorBox
End Sub

Hi,
You could use EssVDisconnect which takes a sheet name and does not open the disconnect login box.
Declare Function EssVDisconnect Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant) As Long
Sub DisConn()
X=EssVDisconnect("Sheet1")
End Sub
Cheers
John
http://john-goodwin.blogspot.com/

Similar Messages

  • How to get active user data using vba code in excel

    Start with this script: http://community.spiceworks.com/scripts/show/1572-list-user-info-in-excel
    Then add an extra line to get the msDS-UserAccountDisabled attribute, or test for it in an If/Else block.

    Could you please help me to get only active user details from active directory using vba code.
    Any help would be immensely appreciated.
    Thanks in advance
    This topic first appeared in the Spiceworks Community

  • Extract image in PDF file - vba code in Excel

    Hi All,
    I am applying a solution for my company. We have some Front offices which receive customers' requests in paper form.
    We have one Back Office which is receiving the customers' original paper requests from Front Office via courier mail.
    To improve the efficency, I am trying to apply a solution which allow the Front Offices to scan the paper requests into PDF files.
    Those scanned files will be accessed by Back Office to process.
    Given the volume of the requests, it is impossible to open each file in the folder by clicking mouse.
    I have completed the tool (using Excel and vba ) which displays all of the requests (PDF files) as hyperlinks in Excel list.
    The requests are ranked with priority so that the Back Office people know which to process first.
    That solution works well.
    However, Back Office has just requested me to display certain fields in the PDF files as image in Excel's cells so that they can type the information to the system without having to open the PDF files.  The way that the images are displayed on Excel cells is an extraction of part of PDF page.
    I know that in Adobe Reader, I can use my mouse to select part of the area then copy to clipboard, so I hope that we can do the extraction programmatically.
    Could anyone can help me figure out how to implement above extraction solution in Excel vba?
    I am facing 2 concerns:
    1. Acrobat SDK:
    I don't know if my company purchased license of Acrobat SDK or not.  But when I open Excel VB editor, I can see in "Reference" menu the below items:
       + Adobe Acrobat Browser Control Type Library 1.0
       + Adobe Acrobat 9.0 Type Library
       + Acrobat Access 3.0 Type Library
    Are the above enough for my application?
    2. VBA code for extraction of part of PDF files:
    - What should be on the vba code for the extraction?  Which functions I should use?
    Thank you very much
    Cheers

    The functionality that you require is not available to VBA/COM - it is only exposed via C/C++.
    However, you could retrieve the ENTIRE page image to the clipboard and then use whatever VB/VBA methods you choose to grab a section of the image.
    Of course, this all assumes that Adobe Acrobat is installed on each person's computer that will be using the solution since Reader does not have the necessary APIs and Acrobat can't be installed on a server.

  • Need Port number for active Host name using java code

    Hi All,
    I have tnsnames string and I know one of the following Host is working  say Primary-host .
    DESCRIPTION =(ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(HOST = Primary-host)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = Secondary-host)(PORT = 1522)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ORA112DB)))
    Could you please help me to get Port number of only primary Side ?. This needs to do because we cannot get port number using any oracle query.
    Thanks in advance
    JPrashant

    You may get client's host IP with
    select sys_context('USERENV','IP_ADDRESS') from dual;
    You may get client's port with
    SELECT port FROM v$session where username = user;
    To get connection port you should issue OS command (*nix) like
    netstat -n | grep <client_ip>:<client_port>
    tcp 0 0 192.168.1.1:1521 132.168.1.2:65432 ESTABLISHED
    To run OS command (keeping in mind all possible security consequences) it is possible to write C, java code.
    Example -- http://www.oracle.com/technetwork/database/enterprise-edition/calling-shell-commands-from-plsql-1-1-129519.pdf

  • Regarding Error Handling  by using VBA code

    I want to skip the "Server Error in '/' Application" in one page( page 5), and goback to previews worked page (page 4) , continue to next page( page 6).
    If errNumber = -1 Then
    RSWApp.GoBack
    RSWApp.GotoPage (6)
    End If
    but it didn't go back.

    Then try adding the code for GoBack in the Before Play event of Page 5.
    If errNumber = -1 Then
    blnPg5Err = True
    RSWApp.GoBack
    End If
    Also add a boolean so when you go back to Page 4, you know that the reason you are there is because of error on Page 5. And in the code for Page 4, add validation like
    If blnPg5Err = True then
    'whatever you need to do
    rswapp.gotopage(6)
    end if
    You will have to declare blnPg5Err in the Shared Module
    Public blnPg5Err as boolean.
    Hope this works for you.

  • VBA Code for Excel Add-in Menu Items

    Howdy.
    Every month my team needs to execute the same process on a couple hundred documents. It's time consuming and inefficient to say the least, so I'm looking for a means by which to call a couple of the menu items on the Excel BPC Add-Ins menu via VBA. Specifically, Park'n'Go; Expand All; and Send and Refresh Schedules.
    Basically what happens is this:
    Open File
    Set Park'n'Go to Live
    Expand All
    Refresh and Send Schedules
    Set Park'n'Go to Offline
    Save
    Exit
    Loop
    I know how to loop through the files and directories, I just don't know the commands for the functions from the menu via code. The macro recorder can't help me, and I've even tried to mimic a user's actions by using mouse coordinates and clicks, but that doesn't work b/c it doesn't allow for the necessary load time from BPC.
    Any help would be extremely appreciated.

    Hey Jeff,
    here are some vba commands that may help you.
    Open a certain file: (you can assign "Path" to a button or range)
    Dim Path As String
    Path = Application.GetOpenFilename("All Files (.),.")
    Opening the Park 'n Go dialog box:
    Application.Run ("MNU_ETOOLS_PARKNGO")
    Expand All:
    Application.Run ("MNU_ETOOLS_EXPAND")
    Sending data and refreshing the workbook:
    Application.Run ("MNU_eSUBMIT_REFSCHEDULE_BOOK_REFRESH")
    Saving a file OFFLINE:
    Dim FName As String
    FName = InputBox(prompt:="Please enter filename")
    If FName = "" Then
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Else
    ActiveWorkbook.SaveAs Filename:="c:\" & FName
    ActiveWorkbook.Close
    End If
    Application.DisplayAlerts = True
    Hope, that will help you
    Karsten

  • Excel 2013: Lost VBA Code From Excel 2010

    Just upgraded from Office 2010 to Office 2013.
    Tried to open several of my Excel spreadsheets created in 2010 with Excel 2013. I have spreadsheets that have VBA to perform several functions and routines.
    None of the .xlsm spreadsheets from 2010 work in 2013. I get the following messages:
    "The Visual Basic for Applications (VBA) macros in this workbook are corrupted and have been deleted. The macro corruption most likely exists in the current file. To recover the macros, open a backup copy of this file if you have one."
    OR ...
    "We found a problem with some content in '*******.xlsm'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes."
    Clicking Yes does not help. It removes or tries to fix the issue. Under the developer tab, the "Visual Basic" and "Macros" button is disabled.
    I tried 3 of my different workbooks. They all get the same error. I went back to an Office 2010 installation and all the workbooks open file - without error, and the code executes.
    Advice?

    I'm getting the same problem, but with Excel 2010.
    I've created a workbook with macros in Excel 2010 and couldn't run it in two computers with office 2010. The same problem as above occurs:
    "The Visual Basic for Applications (VBA) macros in this workbook are corrupted and have been deleted. The macro corruption
    most likely exists in the current file. To recover the macros, open a backup copy of this file if you have one."
    This problem happened with other 2 workbooks with macro. It's curious too that another workbook with macro created by
    me is working on these two computers without errors. And, of course, all of the workbooks mentioned works well in the other computers. This problem started when I downgrade the office os this two computers from 2013 to 2010.
    None of the solutions proposed above has worked.
    Any ideas?
    Thanks in advance!

  • How to open vba code in excel on Mac Air?

    Some one sent me an xlsx file produced on VBA. On a PC you can access the code with Alt F11 but that does not work on Mac.
    There must be an alternative procedure.  Thanks in advance for a suggestion.  I am on OS X Lion

    If you have Excel 2011, you enable the Developer Ribbon, then you'll have access to the VB Editor:
    http://excelsemipro.com/2010/11/excel-2011-for-mac-installation-preferences-and- vba/
    I do not know how "complete" the VB is in Excel 2011 because IIRC, previous versions of Excel for Mac did not have VB.

  • Kann man mit "Adobe Acrobat STANDARD XI" Formularfelder automatisch per VBA-Code aus Excel heraus füllen oder benötigt man dafür "Adobe Acrobat Professional XI" ?

    Hallo,
    in unserer Firma hat das automatische Ausfüllen von PDF-Formularen in der Vergangenheit wunderbar funktioniert. Dabei wurde per Visual Basic Code der Inhalt von Excelzellen oder auch Excelnamen automatisch in ein PDF-Formular übertragen und die Datei im Anschluss in einem bestimmten Verzeichnis abgespeichert. Jetzt wollen wir auf Adobe ....XI updaten und wissen nicht, ob wir die Standard- oder die Professionalversion benötigen, um dieselbe Funktionalität in Bezug auf das erwähnte Vorgehen zu erhalten.
    Weiß jemand da mehr als ich?
    Also...
    ...reicht Standard?
    oder
    ... muss es Professional sein?
    Gruss und Danke im Voraus,
    Andreas

    Hallo,
    Danke, aber auf der Seite war ich schon und die hat meine Frage nicht eindeutig beantwortet, da ich nicht weiß, unter welchen der Stichpunkte mein Problem / meine Aufgabenstellung fällt.
    Ich vermute, dass die Standardversion reicht, aber bevor wir 5 Lizenzen davon kaufen, wüsste ich gerne, ob es funktionieren wird.
    Und könnte man zur Not die Standardversion dann zur Professional upgraden, auch auf einem Terminalserver?
    Andreas

  • Problem with SAP log-in using VBA with Excel Bexanalyzer add-in

    I am trying to login in to SAP using VBA code but the code fails as indicated below .
    In Function GetBEx(Optional iWb As Workbook) As Object
    GetBEx = pAddin.ExcelInterface.WorkbookBExExcelApplication(lName)
    Works properly – I get an object
    However, in the sapBEXgetConnection function it seems that the lBex.ComConnection fails.  The p_connectionObj doesn’t get assigned (p_connectionObj is Nothing)
    Function sapBEXgetConnection(Optional IWhat As Integer) As Variant
        If IWhat = 0 Then
    ' try to get BexApi Connection
            Dim lBEx As Object
            Set lBEx = GetBEx
            On Error Resume Next
            Set p_connectionObj = lBEx.ComConnection  'fails here
            If Err.Number <> 0 Then Set p_connectionObj = Nothing
            On Error GoTo 0
            If p_connectionObj Is Nothing Then If Not prepareConnection Then Exit Function
            Set sapBEXgetConnection = p_connectionObj
        End If
    End Function
    All of this code is part of the Bexanalyzer Excel Add-In
    I’m assuming that I’m missing a patch or some configuration is incorrect but, since I’m not very familiar with SAP I don’t know.  Any help would be greatly appreciated.  Thank you.

    Hello Sebastien,
    Since I don't know what an SSO automatic connection is I can't give you an answer.  Can you explain it?
    Here's what I'm trying to achieve: on demand I'd like to execute VBA code that will use Bexanalyzer.xla functions to log in and then refresh a query that exists in the Excel workbook. Ultimately I'll want to apply parameters / variables to the query when it is refreshed.  I may then automatically execute VBA code to manipulate the resulting data in the workbook.  Basically I want to be able to do all of this without any user input.
    Paul

  • Adding Multiple files to many Sharepoint Sites based on the Sites Code (Splitting the data using a code)

    Hi,
    I'm pretty new to Sharepoint and wanted to ask a question to see if it can actually do what we need it to do.
    We would have a top Site within a collection and under this we would have 400 sites for different sections of the business (External) Lots of teams create documents for all these sites and use the Code of the site in each document so we know what business
    site its going to. For example 67890_BusinessReportMay.docx We know this document should be heading to site 67890 
    We have lots of services sending data to these 400 business sites. If we were to do them manually it would take most of our time to go to each site and upload the documents, even if we could do all the sites documents in 1 multiple upload. We still have
    to go to each site to do it
    Is there an easy answer to this? At present I have folders to match each of the 400 Sharepoint Sites and I use an Integration Services package to move all the documents into these 400 Matching folders. I do this using the Code at the start of each file name.
    If it doesn't have a code its put into an error folder and reported back on.
    Then I want something to automatically go through each of these folders and load them into the Sharepoint Sites document libraries. 
    OR
    Say you have 600 files all going to the 500 sites on Sharepoint in one folder. The File contains meta data regarding the Sites Code.  Using this you can split the files and automatically pull them across to the Sharepoint Sites without having to go
    into each Sharepoint Site?
    I'm thinking that you cant do this and I'm hoping I'm wrong. Any help would be greatly appreciated.  
    Debbie

    Hi Debbie,
    According to your description, my understanding is that you want to move the documents to different sites based on the code in the name of the files.
    I recommend to create workflow and set the workflow to start when an item is created to achieve this goal.
    As there is no built-in action which can move the documents cross site, we need to use the custom activity 'Copy List Item Extended' which need to be downloaded from
    http://spdactivities.codeplex.com/.
    Please per the steps in the link below to deploy the custom activity to SharePoint:
    http://social.technet.microsoft.com/Forums/en-US/82609160-152f-461a-9a19-0e996f5a309b/sharepoint-2010-archiving-the-files-from-one-document-library-to-another-document-library-in
    After that, we can create a workflow to meet the need.
    Here is the detailed steps to create the workflow:
    Create a column in single line of text type(called NO for example) in the library where the documents are uploaded, and input value manually in the column to store the code when uploading the documents. (We can also use workflow to extract the code from
    the name of the documents if the codes are always 5 numbers.)
    Create a workflow associated with the library and set the workflow to start when an item is created.
    Select If current item field equals value, change the settings to be If Current Item: NO equals 67890.
    Select Copy List Item Extended, change the settings to be Copy item in Current Item to list at site 67890 URL.
    Select Delete Item, change the settings to be Delete Item in Current Item.
    Create other conditions from step 3 to step 5 to copy the documents to different sites and delete current documents.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Excel to SAP using VBA

    I would like to know if there is any possible way of exporting data from excelt to SAP using VBA code. I was going through one of the blogs /people/kathirvel.balakrishnan2/blog/2006/05/09/data-upload-into-sap-from-microsoft-excel-150-vba-part
    where in the data was exported from excel to SAP with the help of table name. Can the same be done using trasaction codes in SAP? If so, how.
    Also, I would like to know,if I can record a particular session(as how we do for recording a macro in excel) and use the same recorded session for other entries too.
    Thanks a lot in advance.
    Regards,
    P.Yogesh

    Hello,
    Whatz impossible ??
    Yes you can export the data from excel to SAP using VBA, but you need to create fome RFC in SAP as well that will handle the data you will send.
    1. Create a RFC function in R/3 that will read a file from specific location and perform the respective transaction.
    2. Create your excel file with respective file format and call the RFC function in SAP passing the parameters as file name and other required details.
    3. SAP coding for RFC will be a single time activity and then onwads you can just create excel file for upload and use VBA code to initiate the RFC call.
    Hope this make some sence. Tell me if you have more queries.
    Regards,
    Vishal
    Reward points.. if helpful

  • Smart View Ribbon not shown when Excel is invoked using VBA

    Dear Hyperion Gurus,
    I am in need to invoke smartview refresh by calling excel using VBA from an excel module in another sheet(master template). But when I invloke Excel using VBA, smartview ribbon does not get activated, due to which the HypConnect, HypVMenuRefresh command does not work. If I directly open excel and run the module it connects fine and does the refresh without any problem. I have tried to enable and disable smartview using VBA but it does not work either. If I call excel directly using a batch using Call command, then it works fine, however the batch file does not close as if I use ThisWorkbook.Close command, then it does not completely close Excel, the instance still runs, and if I try to close using Application.Quit, then it closes down Excel completely. Any help would be highly appreciated.
    Thanks and Regards,
    SiddN.

    Hi,
    I was able to achieve this using batch files by calling the excel templates one by one.
    Thanks,
    SiddN.

  • Problem JDBC Connection using OCI Driver on Weblogic Portal on Linux

    Hi Team,
    I want a JDBC connection using OCI Driver in Weblogic Portal 8.1 sp4 on Linux. When I had tested using JDBC connection using Plain Java Code it is working. Also when I create the OCI Connection Weblogic Connection Pool it is working.
    But My Requirement is to create the connection using Java Code in Portal Application
    But When I create OCI connection in the code it is throwing NO SUITABLE DRIVER Found.
    ---------- Code in Plain Java Code ------------ Same code is used in Weblogic Portal Application --------------------------------
         public static void main(String[] args) throws Exception{
              Class.forName("oracle.jdbc.driver.OracleDriver");
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              String url="jdbc:oracle:oci8:@TESTDB";
              Properties props = new Properties();
         props.put("user","scott");
         props.put("password","tiger");
              conn=DriverManager.getConnection(url,props);
    When I am using the same code in Weblogic Portal and Deployed on Weblogic Portal Server 8.1 SP4 it is throwing following error.
    -------------- Exception on Server Log --------------------
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(Ljava.lang.String;Ljava.util.Properties;Ljava.lang.ClassLoader;)Ljava.sql.Connection;(Unknown Source)
    at java.sql.DriverManager.getConnection(Ljava.lang.String;Ljava.util.Properties;)Ljava.sql.Connection;(Unknown Source)
    My Environment is
    LINUX
    Weblogic 8.1 SP4
    Oracle 9i Client on Same Machine
    Oracle 10g Server on Different Machine
    My Environment Variables on the Linux Server also set properly as following
    PATH=/apps/pmaaum/ant/apache-ant-1.6.5/bin:.:/apps/beahomedev/jdk142_05/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/apps/oracle/ora9i/product/9.2.0/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/apps/oracle/ora9i/bin
    LD_LIBRARY_PATH=/usr/lib:/apps/oracle/ora9i/product/9.2.0/lib:/apps/oracle/ora9i/product/9.2.0/lib32:/apps/oracle/ora9i/product/9.2.0/rdbms/lib:/usr/openwin/lib:/apps/oracle/ora9i/product/9.2.0/jdbc/lib
    JAVA_HOME=/apps/beahomedev/jdk142_05
    JDBC_LIB=/apps/oracle/ora9i/product/9.2.0/jdbc/lib
    CLASSPATH=:.:/apps/beahomedev/jdk142_05/lib/rt.jar:/apps/oracle/ora9i/product/9.2.0/jdbc/lib/classes12.jar
    Please help me, Let me know if you required anything.
    Thanks in Advance
    Vishnu
    Edited by: vishnuk on Oct 23, 2009 4:07 AM
    Edited by: vishnuk on Oct 23, 2009 4:10 AM

    Hi Vishnu
    Looks like a classloader issue. BEA class loader is very tricky. Any jar added manually in classpath, will end up loading only those classes. Any imports that we have in any of those classes do not get loaded. Anyhow, coming to your point, add classes12.jar inside your portal web project Web-Inf/lib folder and see if that helps. Usually thats where we put all the JARs for 8.1 SPxx applications. If this still breaks, then remove the jar from web-inf/lib folder and add under your portal app App-Inf/lib folder. First try with app-inf/lib folder having this jar. If not then with web-inf/lib. Basically web-inf is specific to that web app only. If you have a different app having this jdbc code, then put under app-inf/lib folder. Make sure that you remove the classes12.jar that you added in classpath either in env variable or in setdomainenv.cmd file.
    When weblogic uses native OCI Drivers, it refers to jars at this location: ....\beawlp814\weblogic81\server\ext\jdbc\oracle\10g or 9g. Try using one of these jars and see if that works. Most of the times I used these jars only for oracle specific native drivers.
    Word of caution. Try to use Connection Pool and a DataSource created in weblogic console for your jdbc code. This Datasource can still use the Oracle drivers that you want (instead of BEA Weblogic wrapper oci drivers) located in above location. Use JNDI Lookup and get Datasource and then connection. This is more recommended approach with many advantages then using DriverManager approach..
    Goud

  • Where is the forum for writing VBA code to control SharePoint 2013

    For Example, I want to use VBA code to create a SharePoint list and maintain it.  I can't find how to do that.  In Office 2003, we had the SharedWorkspace Object; but that's been deprecated.

    Current way to go is either CSOM or the SharePoint 2013 REST API. I'm not great at VBA, but I assume the REST API is the only option for you. Here you can find more info:
    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

Maybe you are looking for