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

Similar Messages

  • Blocked Error Messages and VBA Macros

    I have a client who is in the process of migrating their Essbase 6 VBA macros to 7. Will the error messages regarding the different APIs impede upon the macros running correctly and fully?<BR><BR>I don't think this would be the case but wanted to double-check...

    Hello.
    I have created an dynamic Excel VBA template which include as well this log-function.
    Public Function Create_Log(lngRow As Long, lngCol As Long, strLog As String)
        Dim lngCounter As Long
        Dim lngLast_Col As Long
        Dim strLog_Line As String
        lngCounter = lngRow
        lngLast_Col = lngCol
        strLog_Line = strLog
        If ThisWorkbook.Sheets("SAP_PROCESS").Cells(lngCounter, lngLast_Col).Value = "" Then
            ThisWorkbook.Sheets("SAP_PROCESS").Cells(lngCounter, lngLast_Col).Value = strLog_Line
        Else
            ThisWorkbook.Sheets("SAP_PROCESS").Cells(lngCounter, lngLast_Col).Value = ThisWorkbook.Sheets("SAP_PROCESS").Cells(lngCounter, lngLast_Col).Text & Chr(10) & strLog_Line
        End If
    End Function
    In my process code I use this function like this:
    'Log
    If Session.FindById("wnd[0]/sbar").Text <> "" Then Create_Log lngCounter, lngLast_Col, Session.FindById("wnd[0]/sbar").Text
    We can check as well if we receive an error (sy-msgty = 'E')
    If Session.FindById("wnd[0]/sbar").messagetype = "E" Then Create_Log lngCounter, lngLast_Col, Session.FindById("wnd[0]/sbar").Text
    Hope this give you an idea how to handle this.
    Best regards,
    Holger

  • 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

  • I am mac user and want to create Object in VBA macro. when i write "set objwrd=createObject("Word.Application")"- it returns "runtime error "492" can't create object". now what it alternative to create object for word in excel macro???

    I am mac user and want to create Object in VBA macro. when i write "set objwrd=createObject("Word.Application")"… it returns "runtime error "492" can't create object". now what it alternative to create object for word in excel macro???

    Any help here...
    http://support.microsoft.com/kb/288117
    http://www.macworld.com/article/1154785/welcomebackvisualbasic.html

  • Runtime Error '109' - Business Object 6.5 - VBA macro

    I am getting the same Runtime error '109' when trying to run my old reports(6.5) which have VBA Macros with the new XI 3.1 DeskI. Here's what I did:
    1) Installed BO XI 3.1 client Tools on a machine which has BO 6.5 client tools
    2) Opened the .rep in the XI 3.1 DeskI. CLick OK when it warns you that it is a earlier version and If you want to convert to new version.
    Then when i try to run the report i get this error. The same .rep runs just fine with 6.5 Full Client.
    Any Ideas guys? Am I  missing any references or something ?
    Thanks
    Edited by: Larry Sherman on Aug 14, 2009 8:28 PM

    Larry, I have seen some instances of VBA code not running in  the new Deski version, possibly some calls are different. You will want to open an SAP incident for eng. to take  a  look at the VBA code.

  • 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.)?

  • Schedule a VBA macro based DeskI Report.

    Hi,
    We have a requirement to schedule a VBA macro based report via CMC and Infoview and I would like to acheive the below. Please help.
    1) To save the report output as CSV file after refresh in Xi R2 and I have the following code, which runs fine if I run manually, but if I schedule it in Xi R2, it does not run.Please help.
    Private Sub Document_AfterRefresh()
    Dim boDP As busobj.DataProvider
    Set boDP = ThisDocument.DataProviders.Item(1)
    OUTPUT_FILE_CSV = TARGET_FILE_DIR & OUTPUT_FILE_NAME & Format(Now, "YYYYMMDD") & "_" & Format(Now, "hhnnss") & ".csv"
    Call boDP.ConvertTo(5, 1, OUTPUT_FILE_CSV)
    End Sub
    The OUTPUT_FILE_CSV & TARGET_FILE_DIR are declared as global varilable. Please help.
    2) A prompt to be filled and the following syntax works fine when I run the macro manually. But does not work when I schedule in CMC (Variable prevented report to refersh error)..
    Private Sub Document_BeforeRefresh(Cancel As Boolean)
    newfromdate = DateAdd("M", -4, DateValue(Now))
    Application.Variables.Item("BOL Date").InterpretAs = boStringVariable
    Application.Variables.Item("BOL Date").Value = newfromdate
    End Sub
    Please advice.
    Thank You.

    Hi Sundaresan,
    Following are the important points related to scheduling deski report containing VBA macro:
    1. BusinessObjects XI Release 2 supports macros in
        Desktop Intelligence in InfoView, both when viewing or
        scheduling the document, but with caveats.
    2. There are slight differences in the execution flow when
        viewing a Deski in InfoView as opposed to viewing on
        the Desktop Intelligence client.
    3. A restriction on scheduling documents is that the
        scheduler can only open one document at a time u2013 so
        if you have macros that try and access another Deski
       document, it will fail.
    4. Whether a macro executes successfully or not would
        depend on the functionality used in the macro.
    May i know which service pack you are using,as this is known issue and it works fine with BOXI R2 SP2 and higher versions.
    I hope this helps you.
    Regards,
    Snehal

  • Run Data Package from custom Menu00F9/VBA macro

    HI guys,
    I have a problem:when creating VBA macro to run Data Package.
    I get the pop-up error "400" . This is the VBA code I'm using:
    Application.Run "MNU_eDATA_RUNPACKAGE(""Opening""; ""/CPMB/Opening_Balances""; ""Company""; ""Financial Processes"")"
    Have you any suggestion for me?
    Thanks
    Marco Uccello

    Hi Marco,
    I'm guessing by prompts you mean user inputs for Entity, Category, Time etc.
    These are controlled by the dynamic script associated with the data package.
    If you go to the menu eData -> Organise Packages then select a package and go through :
    Modify Package -> View Package -> Advanced
    You should get to the Data Manager Dynamic Script window.
    The following is an example of what should be in here. This is taken directly from the SAP How to Guide "How To Pass Dynamic Parameters to script logic.pdf"
    It's the "PROMPT" parts at the start that control the prompts shown to the user (and passed to the data package) :
    PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%,%CATEGORY_DIM%,%CURRENCY_DIM%,%TIME_DIM%")
    PROMPT(TEXT,%WS_PERCT%,"Input W/S Percent in decimals",)
    PROMPT(TEXT,%EXP_PERCT%,"Input Exp. Percent in decimals",)
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,TAB,%TAB%)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,EQU,%EQU%)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,SUSER,%USER%)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,SAPPSET,%APPSET%)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,SAPP,%APP%)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,SELECTION,%SELECTION%)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,LOGICFILENAME, INCREASEPERCENTAGE.LGF)
    TASK(ZBPC_PROMPT_EXP_RUN_LOGIC,REPLACEPARAM,WS_PERCT%EQU%%WS_PERCT%%TAB%EXP_PERCT%EQU%%EXP
    _PERCT%)
    If you paste that in exactly it will resolve into the right package information which can be seen one step back (via Modify Package -> View Package).
    You can modify the prompts as appropriate for the script you are running - the one above from the how to guide has two inputs for percentages which are used within the associated script logic calculation.
    Hope this helps.
    Thanks.
    Bradley Newcombe.

  • VBA macros

    Hi Everyone!
    We are using RoboHelp 7 (WebHelp) and MS Word 2007 on 3
    machines. When selecting Printed Documentation and then selecting a
    MS Word Template in the Printed Documentation Dialogue box, two of
    the machines are able to print the documentation but an error
    appears on the third machine. The error reads:
    Waiting for VBA macros to be registered.
    The applications were all installed in the correct order
    according to the steps followed in another section on this site.
    Anyone have any idea why this machine is receiving the error and
    the other two are not/
    Thanks.
    Bill

    My guess is you need to change their macro security levels in
    Word.

  • EVHOT in a vba macro

    Hello,
    with a VBA macro I want to simulate the launch of an EVHOT with the current view paramtere's passage .
    Is it possible?
    What is the function name to use?
    Thanks,
    Fabiola

    You can try to open the documents with a password that is guaranteed to be wrong, i.e. a password that isn't used for any of the documents. If the document has no password, Word will open it without complaining - it only checks the password if the document
    is password-protected. If the document does have a password, error 5408 will occur, and you can trap this error with an error handler. For example, with a variable doc of type Document and a variable strPath of type String that contains the full path of a
    document:
    On Error Resume Next
    Set doc = Documents.Open(FileName:=strPath, PasswordDocument:="!@#$%")
    If Err = 0 Then ' no error occurred
    ' Process the document
    ' And close it
    doc.Close SaveChanges:=True ' or False
    End If
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Word 2013 VBA Complie error in hidden module: frmabout

    Cannot seem to find a resolution to this problem.
    Happening on one system and weirdly only one user profile.
    Each time the user of profile one opens or closes MS Word 2013 they receive a dialog box indicating the following.
    VBA : COMPILE ERROR IN HIDDEN MODULE: FRMABOUT
    THIS ERROR COMMONLY OCCURS WHE CODE IS INCOMPATIBLE WITH THE VERSION, PLATFORM, OR ARCHITURE OF THIS APPLICATION. CLICK "HELP" FOR INFORMATION ON HOW TO CORRECT THIS ERROR.
    On the same system user, profile two opens and closes MS Word 2013 without any error. 
    Word 2013 seem usable even with the error it's just annoying to the end user.
    System is not connecting to a domain or external server.
    Any assistance is appreciated.
    Art

    Hi,
    For the error message, the FRMABOUT macro code in that template is not compatible with any recent version of Word. We may try to find the template and rename it.
    The template is typically named FRMABOUT.dotm, although the number may be different depending on which version of the wizard you installed.
    There are three possible locations to find the template:
    %appdata%\Microsoft\Word\STARTUP
    C:\Program Files\Microsoft Office\Office15\STARTUP
    C:\Program Files (x86)\Microsoft Office\Office15\STARTUP
    For the first one, paste the path into the address bar of the file explorer and press Enter, so the %appdata% part gets expanded to the proper place in your user profile.
    The last of the locations will exist only if you're running 32-bit Office on 64-bit Windows.
    Look in each place and rename the file wherever you find it. Then restart Word.
    More reference:
    http://support.microsoft.com/kb/921541/en-us
    Regards,
    George Zhao
    TechNet Community Support

  • VBA Macros Running Before BPC Routine is Done

    Hello, All -
    Working on converting our BPC 7.5 templates to version 10 and I'm having an issue with our custom VBA macro codes.
    In our 7.5 system, all our input templates call custom VBA macro routines when certain SAP functions are done executing (i.e.: once a Refresh is done, execute this macro code).  In 7.5, we have macro codes within the BEFORE_REFRESH, AFTER_REFRESH, BEFORE_EXPAND, and AFTER_EXPAND routines (note: our templates utilize the EvDRE function) and our custom macro codes would not run until the SAP function was done processing, which worked out perfectly however, it appears that something has changed in version 10 as all our macro codes are executing even though the SAP system is still processing in the background.  I confirmed this behavior by placing a macro stopper next to certain macro codes and noticed that VBA is already at that point of executing those codes yet in the background, I can still see the 'processing' box. In 7.5, the processing box is already gone before the custom macro code executed.  Not sure why the macros are executing when SAP is not done fully processing yet.
    Has anyone encountered this type of behavior where custom VBA code is running prematurely before SAP is done processing?
    In addition, it appears that SAP is no longer utilizing the Excel Status bar when certain processes are being executed. In 7.5, when a Refresh command was executed (for example), the status bar at the bottom of Excel would be updating (ready...retrieving data...calculating...formatting, etc...), which allowed us to check the Status bar for the word 'COMPLETED' as this was our indicator that SAP was done processing.  In version 10, it appears that SAP has done away with the use of the Status bar because I am no longer seeing any kind of message flowing through down there when certain SAP functions are running.  Correction: the only messages I see are 'Ready' and a brief moment of 'Calculate'.  Because nothing is appearing on the status bar, our custom macro codes are not working in the new version.
    Does anyone know if this feature no longer available in version 10?
    Other Information:
    + Office 2010
    + BPC v10 on Microsoft platform
    + EPM Server version: 10.0 SP16
    + EPM Add-in version: 10.0 SP21 .NET 3.5; Build: 9094
    Thanks,
    Carlo

    ADDENDUM:
    7 hours later.... to log in was "random", replies mostly not possible, two different error massages, the nice "looking for" and a generic "too many server access try later" (<<in German, my humble translation)
    there IS a lot of working going on, only explination...
    hope, we read some "Announcement"...
    it's late here, byebye, nitynite...

  • Using AppleScript to Launch Excel VBA Macro

    Using MS Office 2004 and AppleScript 1.9.3. I want to use AppleScript in MS Entourage to kick off a VBA macro in Excel. But no luck.
    To test things, I created an Excel file ("test.xls") with a one-line VBA macro named "test." It just puts up a dialog box with the message "success." I'm calling it from A.S as follows (per the AppleScript Dictionary for Excel 2004):
    tell application "Microsoft Excel"
    run VB macro "hard disk:users:xxx:desktop:test.xls!test"
    end tell
    I get two successive error messages:
    1. 'test.xls' cannot be accessed. The file may be read-only or you may be trying to access a read-only location."
    2. "Microsoft Excel got an error: "hard disk:users:xxx:desktop:test.xls!test" doesn't understand the run VB macro message."
    "test" file permissions are -rw-r--r-- and it is sitting right on the desktop.
    FWIW, I did not remove the old Office vX yet, but renamed old Excel "Microsoft ExcelOld". I read on some other site that this may cause problems.
    This has been endlessly frustrating. HELP!!??
    Steve

    Hi Steve,
    Have you tried dealing with the return value from your macro? If you are invoking the MsgBox function in your test macro, you may need to allow the return value from MsgBox to pass thru back to AS. Something like :
    set MyRetCode to run VB macro "Macintosh HD:Users:xxx:Desktop:test.xls!test"
    (Note unless you've changed the hard drive name to "hard drive", the default boot drive name will probably be "Macintosh HD". Case does matter here)
    I also suspect you'll need to have Entourage up as well in the full case of running a macro in Entourage from Excel (or the other way around). Hence, the command ActivateMicrosoftApp in the Excel dictionary may also be useful.
    Second, you can have a macro, in a startup template, in Entourage call a macro in a startup template in Excel to accomplish what you want without going into AppleScript at all. This latter, VB-only, method will require a "Reference", as it's called in VBA, to be added to the TemplateProject in Entourage that points to the Excel macro you want to fire off. The added benefit of this latter method is that you will have access to the full range of VBA commands/options, rather than the smaller dictionary available in AS.
    Ed
    PB G4   Mac OS X (10.2.x)  

  • How Can I Schedule a Deski Report in Infoview that has a VBA Macro

    Hi experts,
    i've made a report that has a vba Macro. I published it in infoview. If I launch it manually (clicking on the refresh button) the macro works normaly. If I schedule it the macro doesn't work.
    What can I do?
    Is it possible to make a program that simulate the opening and click on the refresh button?
    Or i there is another solution?
    Here is my Macro:
    Private Sub Document_AfterRefresh()
    Dim filtervar As Variant
    Dim filterText, Filter As Long
    Dim DocName, NewName As String
    Dim Pathing, TodaysDate As String
    Dim folderName As String
    TodaysDate = Format(Date, "DDMMYYYY")
    Pathing = "
    Ktsdwh0\c$\OutputBO\"
    DocName = ThisDocument.Name
    filterText = "Dpre Cod Produttore"
    filtervar = ThisDocument.Evaluate("=<" & filterText & ">", boUniqueValues)
    For Each sepval In filtervar
        Filter = sepval
        For n = 1 To ThisDocument.Reports.Count
            Call ThisDocument.Reports(n).AddComplexFilter(filterText, "=<" & filterText & "> = " & Filter)
            ThisDocument.Reports(n).ForceCompute
        Next n
            MkDir (Pathing & Filter & "\")
            NewName = Pathing & Filter & "\" & Filter & "-" & TodaysDate & "-" & DocName   'for Prova_Prod.rep
    '        NewName = Pathing & Filter & "-" & TodaysDate & "-" & DocName   'for Prova_Prod.rep
            ThisDocument.ExportAsPDF (NewName)           'to Save as PDF
    Next
        For n = 1 To ThisDocument.Reports.Count
          Call ActiveReport.AddComplexFilter(filterText, "=<" & filterText & "> = <" & filterText & ">")
            ' To delete a Complex Filter, you set it equal to itself...
          ActiveReport.ForceCompute
        Next n
    End Sub
    Please Help!
    Best regards
    Camillo

    Hi Philippe,
    If you are using Windows 2003 with SP2 then it might be the issue as already logged for BOXIR2.
    You can test the issue by using only Windows 2003 without SP2.
    In case your operating system is only windows 2003 then following information and code might be helpful for you to resolve the issue.
    There are a number of things to check when setting up a macro to work through Infoview or scheduled. The first thing is that the macro needs to be triggered to run. This is done by putting a call to the macro in the Document_BeforeRefresh or the Document_AfterRefresh event handler.
    The report server and job server are designed to process one report at a time. Through a macro it is possible to open more than one report, and do various processing with those additional reports. Since the report and job servers are not designed to process more than one report, your macro should not open an additional report.
    The fact that only one report is processed at a time also affects the syntax you should use when referring to a document or report object. In the DeskI client you can use the ThisDocument object to refer to the report which is running the macro. You can also use the ActiveDocument object to refer to the report that is currently displayed. Most of the time these two objects will point to the same report. When the report server or job server process a report there would never be the possibility for a different report to be active, so the ActiveDocument object does not exist. This also applies to the ActiveReport object. Instead of using ActiveDocument your macro code should use the ThisDocument object. Instead of using the ActiveReport object you should use ThisDocument.Reports.Item(1) to refer to this first report tab in a report.
    These items are the most common issues that will cause a macro not to run through Infoview or when scheduled. The best way to debug a macro which is not working in either of those places is to include code which will log the macro's progress to a file. This makes it easy to determine exactly which line of code is causing issues so that it can potentially be corrected.
    #Region u201CWeb Form Designer Generated Code "
    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    End Sub
    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    End Sub
    #End Region
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim myInfoStore As InfoStore
    Dim myEnterpriseSession As EnterpriseSession
    myInfoStore = CType(Session("InfoStore"), InfoStore)
    myEnterpriseSession = CType(Session("EnterpriseSession"), EnterpriseSession)
    Dim DOCUMENT_NAME As String = "document_name"
    Dim query As String = "Select SI_ID, SI_NAME, SI_SUBJECT, " _
    & "SI_COMMENTS, SI_OWNER From CI_INFOOBJECTS Where SI_KIND = 'FullClient' " _
    & "AND SI_INSTANCE=0 AND SI_NAME='" + DOCUMENT_NAME + "'"
    Dim myInfoObjects As InfoObjects = myInfoStore.Query(query)
    Dim myInfoObject As InfoObject = myInfoObjects(1)
    Dim myDeskiDoc As FullClient = CType(myInfoObject, FullClient)
    Dim mySchedulingInfo As SchedulingInfo = myDeskiDoc.SchedulingInfo
    mySchedulingInfo.Type = CeScheduleType.ceScheduleTypeOnce
    mySchedulingInfo.RightNow = True
    Dim myFullClientFormatOptions As FullClientFormatOptions = myDeskiDoc.FullClientFormatOptions
    myFullClientFormatOptions.Format = BusinessObjects.Enterprise.Desktop.CeFullClientFormat.ceFullClientFormatFullClient
    myInfoStore.Schedule(myInfoObjects)
    End Sub
    End Class
    I hope this will help you.
    Regards,
    Sarbhjeet Kaur

  • Using ms project 2007 and vba macro to list all the custom fields used in the project?

    Hi,Using ms project 2007 vba macro, I would like to be able to list all the custom fields used in the project and their corresponding field names. e.g. let us say I create a calculated duration field and name it "expected duration" and the name
    of the field I select is Duration1.
    I am trying to write a macro that will list all the used custom fields such as the result would look like:
    Duration1 ---> "expected duration"
    Text1       ---> "anything"
    Flag1        ---> "....."
    Number1  ---> "..............."
    Can anyone provide me with the solution?
    Regards,
    Chuck

    John,
    I found this module, which provides the the list of custom fields used in the project but does not provide the name given to the field. Here below is the module and hope you could help me achieve this by modifying the macro to list the renamed field.
    ' MSP Checks all Custom Task Fields
    Sub checkfields2()
    'This macro will check and report out which custom task fields are used
    'It requires Project 2002 and above as it relies on the GetField
    'and FieldNameToFieldConstant methods which were not introduced until
    '2002.
    'It does not include resource fields, however it is a simple matter to
    'do it by replacing the pjTask constant with pjResource.
    'Copyright Jack Dahlgren, Oct. 2004
    Dim mycheck As Boolean
    Dim myType, usedfields As String
    Dim t As Task
    Dim ts As Tasks
    Dim i, it As Integer
    Set ts = ActiveProject.Tasks
    usedfields = "Custom Fields used in this file" & vbCrLf
    myType = "Text"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 30
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Number"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 20
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> 0 Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Duration"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If Left(ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)), 2) <> "0 " Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Cost"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> 0 Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Start"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "NA" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Finish"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "NA" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    MsgBox usedfields
    End Sub
    This is what the module gives me. But I would like to have beside Text 1 the name that is shown as below. e.g Text1 is "Test".
    Would you mind helping me achieve this?
    Thanks in advance.
    Chuck

Maybe you are looking for

  • Repoussé with Nvidia GeForce 9600GT 512 Doesn't work?!

    Hey..  i have a problem with Repoussé in Adobe Photoshop CS5 Extended...   The "Repoussé" in 3D tab in Photoshop is Grayed out... This is my system specs: Windows Vista Home Premium  Service Pack 2 2GB DDR2 RAM running at 667 MHZ Intel Core 2 Duo 2.4

  • SQL operations are not allowed with no global transaction by default for X

    Hi All, I am getting the above mentioned error. java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA driver supports performing SQL operations with no global transaction, explicitly all

  • Blurry images in slideshow

    Hi, I have a slideshow with a background and transparent PNG files sliding. However, the PNG's look blurry in the slideshow, but when I right-clicked on the slide and opened the images in a new window to check if it was the compression, the image loo

  • Export data from JSP to Excel on click on button

    Hi, I want to display the table data in my Jsp to Excel on click of "Export to Excel" icon, The data in my jsp table is dynamic, only click of "export to Excel" icon i want the contents of the table needs to be exported to Excel. Can pls anyone help

  • Unable to desribe table in 2.5

    I have Report 2.5 and database 8i. when Im going to make report and select table from "Table Columns Name" I give me error REP-0603: Unable to describe table 'DEMO.EMPLYEE'. ORA-00942: table or view does not exist and also it give me all tables name