9ASTORAGE- Collective macro.

How to execute a collective macro using Storage Bucket Profile(9ASTORAGE). Manually I can select storage bucket profile in Planning Book and execute the collective macro.  With a custom programme or with some kind of logic, I want to execute the macro using storage bucket profile. Any helpis greately appreciated.
thx
Jeff

Hi Jeff,
                 First of all thanks. I learned a new thing today. I am not aware of the "Use Storage Bucket profile" option in period structure.
It seems if my storage bucket profile has weeks and days, if I switch to this option, then the system displays the way data is stored in the livecache in "technical view "9ASTORAGE". It basically displays at the lowest level of periodicity i.e., days in my case.
See Note 737230 - Consulting: Planning in technical periods
This explains you how to work with it.
The answer for your questions:
"where can i find the 9ASTORAGE bucket profile"
You cannot find it in both TR30 and TR32 as this is not a real periodicity. This is a system's "technical period" that co-insides with the lowest granular level of periodicity used in storage bucket profile.
"i just want to automate the process"
You can automate it but you need to make I would say a big change in your configuration as the not explains:
"if you want to execute mass processing jobs for these technical periods (for example, to influence time-based disaggregation), you can create a fiscal year variant that maps the technical periods. This means that you must create periods that always have the corresponding end of the week or month as the end date. This fiscal year variant must then be assigned to the storage buckets profile of the planning area, so that planning buckets profiles with this periodicity are assigned to the data view. The periods in the data view can then be used, and macros for these periodicities can then be created accordingly."
Thanks.

Similar Messages

  • Unable to see User eixt macro in SCM 4.1 - When creating a Collective Macro

    Hello :
    we are SCM 4.1. We have a need to run 4 macro in a sequence.  I felt that I could create a collective macro and list the macro's.. The macro are user exit macro's. and I am unable to see them in the drop down list.. tried to search OSS Notes . did not find a lot of info.
    Would appreciate any insights and suggestions. We are on SCM 4.1
    Raghu

    Hello Andy
    Thank you for the reply.
    I am trying to create a "Collective MAcro" which would run 4 macros.  In hte COllective macro there is a drop down option to select the macro that we want to run.. We can select upto 6 macros..
    In this drop down list, I am unabel to see the 4 user exit macros. The macro that I want to run in a sequence are "user exit macros". They are active and can be executed one at a time in Interactive Planning.
    I am creating a "Collective Macro" as this would ensure that the 4 user exit macros are run in the correct sequence.
    OSS note 907177 refers to availabilty  of "badi macros" in Collective macro. This is only for SCM50..
    We are in SCM 4.1. ANy pointers can be of great help
    Raghu

  • DOI and Script collection/Macro in Word

    Hi experts,
    My goal is to upload macro from file and after upload run this macro inside word document.
    I try to upload macro from file in Script collection using get_script_collection(class I_OI_DOCUMENT_PROXY)  & add_script (class I_OI_SCRIPT_COLLECTION)
    After that I want to execute macro using execute_script(class I_OI_DOCUMENT_PROXY) .
    I always get error when executing macro that some object is missing. Probably macro is not correct written in file.
    Can somebody give me example hove this macro must be written so I can execute him.
    Thanks a lot,
    Drazen

    Hi Drazen Lovrencic ,
    Even I am trying to execute the macro but facing problem. Below is the my code of adding vb script(macro) to the excel spreadsheet and executing it. but stil not working. I am getting error message "Cannot initialize control"
      TYPES:
        TS_SOURCE_CODE  TYPE TEXT1024,
        TT_SOURCE_CODE   TYPE STANDARD TABLE OF TS_SOURCE_CODE WITH DEFAULT KEY.
      TYPES: BEGIN OF TY_SCRIPT,
             VALUE(80) TYPE C,
             END OF TY_SCRIPT.
      DATA: LS_SOURCE_CODE  TYPE TY_SCRIPT,"TS_SOURCE_CODE,
               LT_SOURCE_CODE  TYPE TABLE OF TY_SCRIPT,
               L_RETURN_CODE TYPE SOI_RET_STRING.
    Building the Script - every line has to end with cr/lf
      LS_SOURCE_CODE-VALUE = 'Sub Macro1()'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
       LS_SOURCE_CODE-VALUE = 'ActiveSheet.Buttons.Add(234, 57, 109.5, 29.25).Select'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'Selection.OnAction = "button"'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'Range("G9").Select'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'ActiveSheet.PageSetup.PrintArea = ""'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'With ActiveSheet.PageSetup'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.Orientation = xlLandscape'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.PaperSize = xlPaperA4'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.FitToPagesWide = 1'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.FitToPagesTall = 1'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'End With'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'End Sub'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
    BREAK-POINT.
    DATA: L_SCRIPT_COLLECTION TYPE REF TO i_oi_script_collection.
    DATA: table_url(256).
    DATA: DOC_COOKIE TYPE I.
          L_RETURN_CODE = c_oi_errors=>ret_document_not_open.
          CALL METHOD c_oi_errors=>create_error_for_retcode
            EXPORTING
              retcode  = L_RETURN_CODE
              no_flush = ''
            IMPORTING
              error    = gc_error.
    CALL FUNCTION 'DP_CREATE_URL'
          EXPORTING
            type    = ''
            subtype = ''
          TABLES
            data    = LT_SOURCE_CODE
          CHANGING
            url     = table_url.
    DATA: CONTAINER_CONTROL TYPE REF TO C_OI_CONTAINER_CONTROL_PROXY.
    CREATE OBJECT CONTAINER_CONTROL.
        CALL METHOD container_control->add_document_script
          EXPORTING
            NO_FLUSH       = 'X'
            document_cookie = doc_cookie
            script_name     = 'Macro'
            script_type     = '1'
            script_url      = table_url
          IMPORTING
            error           = gc_error.
        APPEND gc_error TO gt_error_table.
    Calling the script:
      CALL METHOD GC_DOCUMENT->EXECUTE_MACRO
        EXPORTING
          MACRO_STRING = 'Macro_demo_1'
          SCRIPT_NAME  = 'Macro'
          NO_FLUSH     = SPACE
       IMPORTING error = gc_error.
    APPEND gc_error TO gt_error_table.

  • Urgent help needed on Macros

    Hi APO Gurus...
    I want to know how to use Drill_Up and Drill_ Down macros in batch jobs. they work beautifully in interactive mode, but when processed in batch jobs they drill up only for the particular CVC's at the aggregated level specified in the job. We are  selecting all the characteristics in the aggregation level while creating the job. Then we want to drill up on particular characteristic. We are using a collective macro with first macto for drill up and second macro for calculations at the aggregated level. It works fine in interactive mode but drill_up doesnt seem to work in batch jobs.
    Help needed

    Hi,
    You should not be using DRILL_UP and DRILL_DOWN functions in background jobs. Whatever processing you need to do after DRILL_UP should be a separate macro and that should be executed in background at the desired aggregation level (set for the job).
    There is no point in using a collective macro with a DRILL_DOWN, processing and DRILL_UP steps in background job.
    Thanks,
    Somnath

  • How to create a Layout variable in Macro

    Hi Friends,
    I have to run a macro in the planning book which will execute and perform disaggregation / aggregation at whatever level the users enter the data. For Example, if a user enters a data at Product level it has to disaggregate to the SKU level and execute the macro to calculate forecast figures. Always calculating at detailed level gives accurate results. Here am using Drill down and Drill up functionality .
    My question is, should I use any IF condition to perform a check say IF at AGG_LEVEL ('SKU') =1 then perform Drilldown. And for DrillUp should I set a LAYOUT_VARIABLE
    use this to determine if it needs to be drilled up.
    Am not familiar using this condition check and Layout variable creation. Can anyone pls let me know how do create these steps probably with an example.
    Thanks for your help in advance.
    Regards
    Bala

    Hi Bala,
    I suggest you to go through the following SAP standard macro book. It contains a collective macro..DRILL(Start), which in turn contains macros for setting indicators, for doing Drill-down and drill-up and deleting the idicators..In this way u can set your drill-up and drill -down macros for the charectaristics you want and do the automatic drill-up and drill-down.
    SNP94(1)_Interactive Planning
    regards,
    uma mahesh...
    confirm, Am i targetted ur post exactly...if not kindly post back...

  • Control of Macros in APO DP

    I am using APO DP V5.
    I have two questions regarding the use of macros in DP:
    1. Is it possible to call a macro from within a macro?
    2. I believe it's possible to set up a 'collective macro', so that a group of macros can be executed together. But how do I set up a 'collective  macro' - I cannot see this mentioned in the help documentation.
    Thanks,
    Bob Austin

    1. i suppose what you want is calling a macro if some conditions inside the main macro are satisfied..
    some ideas which might give the same effect:-
    instead of calling a macro from a macro can you not just add the macro you want to call as a step inside the first macro? ( unless you want a different macro level settings)
    alternately you can make the first macro cause a value in a temporary row and use the value in the row to trigger the action of the second row using a condition statement in it
    2. am only rephrasing what Ian said by saying the following about collective macros:
    You define a macro as a collective macro when you create it, by setting the Macro type field to Collective macro. Add the macros already created within the steps. If you have already assigned other elements (steps, conditions, and so on) to it, you can no longer define the macro as a collective macro.

  • Saving macro results between steps

    All,
    We have a requirement where we need to save the results from Step 1 of the macro into the livecache before executing the next step - standard macros do not save the results until the Save icon is clicked on. Any ideas on how to do this? Essentially, I am looking to replicate the Save icon except that it is to be triggered from within the macro.
    Thanks
    AR

    I dont think it is possible to do that in foreground mode. Even if you use collective macro there is nothing you can do to save intermediate steps. That is a basic design issue about macros. I think this fact is well documented as well in Macro help.
    If you are doing this in batch however, you should use multiple steps in the activity or multiple activities itself to make sure intermediate steps are committed to the DB.

  • Macros help?

    Hi experts,
                    My requirement is to design a macros for a planning book where apart from other fields i need to compute open demand and shipment plan.My shipment plan formula invloves open demand of previous day and open demand formula needs the shipment plan for the previous day.So i cannot calculate any one of this key figure before the other. But if i calculate all the key figures for one column first and then the next column and so on , then i suppose it will work fine .But i am not able to compute it one column after the other.I am able to do it only one keyfigure at a time across all columns .Can any of you kindly help to compute the key figures column wise
    Kindly help
    regards
    Ashwin

    If you want to avoid the BADIs path, I would recommend to execute the Macro multiple times. ( as many times as number of time buckets) This sounds very performance intensive, however if your calculations are simple, it should be ok.
    The way to do it multiple times will be to use layers of collective macro.

  • DRILL DOWN with 9ATRNAME

    HI all
          i have made a mcro to drill down @ 9ATRNAME characteristic followed by a row_visible macro.
    the collective macro which executes drill down and hiding of key figures is working fine. the only problem is
    the T lanes shown for a particular product location combination for a receipt KF (dist. receipt planned) shows
    all the t lanes possible from or to the location. whereas we want only those lanes to be shown in the KF which
    have to location as the loaction given in the product location combination.
    For example: if i have a warehouse 1002 which is connected to 1001 plant for procurement and 1010 customer.
    when the macro is run in the dist. receipt KF shows both the t lanes 1001-1002 and 1002-1010. But the requirement
    is to only see 1001-1002 since it is a receipt KF. 
    Any pointers would be welcomed
    -Virender

    Hi Virender,
    Rather than choosing against Product - Location, why don't you choose against Product-Destination Location? 9ALOCTO characteristics might be useful. By this you actually select only the location-products which might have data in Dist.Rxcpt KF.
    See whether you canhave this selection via your macro. Or make the macro work only if this selection is made in shuffler.
    Just a thought!
    Thanks,
    Rajesh Manoharan

  • PowerPoint using macro to delete text boxes after printing

    Hi,
    We created custom shows in Powerpoint and are running a macro to insert temporary page numbers on the slides before printing.  The issue is that I need to remove the page numbers after printing.  I'm a novice at VBA so I'm sure there is an easy
    solution, but nothing I've tried so far has been successful.  The code is displayed below for your reference.  Any help is greatly appreciated. Thanks!
    Sub PrintCustomShow()
          ' Change this number to specify your starting slide number.
          Const lStartNum As Long = 1
          ' Ask the user which custom show they want to print.
          Dim strShowToPrint As String, strPrompt As String
          Dim strTitle As String, strDefault As String
          ' See if any custom shows are defined.
          If ActivePresentation.SlideShowSettings.NamedSlideShows.Count _
             < 1 Then
             ' No custom shows are defined.
             ' Set up the string for the message box.
             strPrompt = "You have no custom shows defined!"
             ' Display the message box and stop the macro.
             MsgBox strPrompt, vbCritical
             End
          End If
          ' Find the page number placeholder; if found, pick up the style.
          Dim rect As PageBoxSize
          Dim oPlaceHolder As Shape
          Dim bFound As Boolean: bFound = False
          For Each oPlaceHolder In _
             ActivePresentation.SlideMaster.Shapes.Placeholders
             ' Look for the slide number placeholder.
             If oPlaceHolder.PlaceholderFormat.Type = _
                ppPlaceholderSlideNumber Then
                ' Get the position of the page number placeholder.
                rect.l = oPlaceHolder.Left
                rect.t = oPlaceHolder.Top
                rect.w = oPlaceHolder.Width
                rect.h = oPlaceHolder.Height
                ' Get the formatting of the slide number placeholder.
                oPlaceHolder.PickUp
                ' Found the slide number placeholder, so set the
                ' bFound boolean to True.
                bFound = True
                Exit For
             End If
          Next oPlaceHolder
          ' See if a slide number placeholder was found.
          ' If not found, exit the macro.
          If bFound = False Then
             ' Unable to find slide number placeholder.
             MsgBox "Your master slide does not contain a slide number " _
                & "placeholder. Add a " & vbCrLf & "slide number placeholder" _
                & " and run the macro again.", vbCritical
             End
          End If
          ' Set up the string for the input box.
          strPrompt = "Type the name of the custom show you want to print." _
             & vbCrLf & vbCrLf & "Custom Show List" & vbCrLf _
             & "==============" & vbCrLf
          ' This is the title of the input box.
          strTitle = "Print Custom Show"
          ' Use the first defined show as the default.
          strDefault = _
             ActivePresentation.SlideShowSettings.NamedSlideShows(1).Name
          ' Obtain the names of all custom slide shows.
          Dim oCustomShow As NamedSlideShow
          For Each oCustomShow In _
             ActivePresentation.SlideShowSettings.NamedSlideShows
             strPrompt = strPrompt & oCustomShow.Name & vbCrLf
          Next oCustomShow
          Dim bMatch As Boolean: bMatch = False
          ' Loop until a named show is matched or user clicks Cancel.
          While (bMatch = False)
             ' Display the input box that prompts the user to type in
             ' the slide show they want to print.
             strShowToPrint = InputBox(strPrompt, strTitle, strDefault)
             ' See if user clicked Cancel.
             If strShowToPrint = "" Then
                End
             End If
             ' Make sure the return value of the input box is a valid name.
             For Each oCustomShow In _
                ActivePresentation.SlideShowSettings.NamedSlideShows
                ' See if the show is in the NamedSlideShows collection.
                If strShowToPrint = oCustomShow.Name Then
                   bMatch = True
                   ' Leave the For loop, because a match was found.
                   Exit For
                End If
                ' No match was found.
                bMatch = False
             Next oCustomShow
          Wend
          ' Get the array of slide IDs used in the show.
          Dim vShowSlideIDs As Variant
          With ActivePresentation.SlideShowSettings
              vShowSlideIDs = .NamedSlideShows(strShowToPrint).SlideIDs
          End With
          ' Loop through the slides and turn off page numbering.
          Dim vSlideID As Variant
          Dim oSlide As Slide
          Dim Info() As SlideInfo
          ' Make room in the array.
          ReDim Preserve Info(UBound(vShowSlideIDs) - 1)
          ' Save the current background printing setting and
          ' then turn background printing off.
          Dim bBackgroundPrinting As Boolean
          bBackgroundPrinting = _
             ActivePresentation.PrintOptions.PrintInBackground
          ActivePresentation.PrintOptions.PrintInBackground = msoFalse
          ' Loop through every slide in the custom show.
          Dim x As Long: x = 0
          For Each vSlideID In vShowSlideIDs
             ' The first element in the array is zero and not used.
             If vSlideID <> 0 Then
                ' Add slide ID to the array.
                Info(x).ID = CLng(vSlideID)
                ' Get a reference to the slide.
                Set oSlide = ActivePresentation.Slides.FindBySlideID(vSlideID)
                ' Store the visible state of the page number.
                Info(x).IsVisible = oSlide.HeadersFooters.SlideNumber.Visible
                ' Turn off page numbering, if needed.
                If Info(x).IsVisible = True Then
                   oSlide.HeadersFooters.SlideNumber.Visible = msoFalse
                End If
                ' Create a text box and add a temporary page number in it.
                Dim oShape As Shape
                Set oShape = _
                   oSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, _
                                            rect.l, rect.t, _
                                            rect.w, rect.h)
                ' Apply the formatting used for the slide number placeholder to
                ' the text box you just created.
                oShape.Apply
                ' Add the page number text to the text box.
                oShape.TextFrame.TextRange = CStr(x + lStartNum)
                ' Increment the array element positon.
                x = x + 1
             End If
          Next vSlideID
    ' Print the custom show. NOTE: You must turn background printing off.
                 With ActivePresentation
                 With .PrintOptions
                 .RangeType = ppPrintNamedSlideShow
                 .SlideShowName = strShowToPrint
                 End With
                 .PrintOut
                End With
          ' Restore the slide information.
          For x = 0 To UBound(Info)
             ' Get a reference to the slide.
             Set oSlide = ActivePresentation.Slides.FindBySlideID(Info(x).ID)
             oSlide.HeadersFooters.SlideNumber.Visible = Info(x).IsVisible
          Next x
          ' Restore the background printing setting.
          ActivePresentation.PrintOptions.PrintInBackground = _
             bBackgroundPrinting
       End Sub

    Hi hlolrich,
    According to the description, you want to remove the shapes which created after you print the presentaion.
    I suggest that you name the shape you added with some rule, then we can delete thease shapes via the name rule.
    And here is a sample that you delete the shapes which name contains the
    myShape words on the first slide for your reference:
    Sub deleteShapes()
    For Each aShape In Application.ActivePresentation.Slides(1).Shapes
    If InStr(aShape.Name, "myShape") Then
    aShape.Delete
    End If
    Next aShape
    End Sub
    Also you can learn more about PowerPoint developing from link below:
    How do I... (PowerPoint 2013 developer reference)
    PowerPoint 2013
    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.

  • Create a Macro to Index a Word Document Line by Line

    Background
    I have collected a bunch of keywords and references to where I can find these words in a textbook.  I've put them into a Word document where each line is one Index beginning with the “Main Entry” followed by a colon and then the “Subentry”.  Note
    that in the "Subentry" I have included my reference in parenthesis (b1-m2).
    Example Original Text:
            Main Entry:Subentry (b1-m2)
    Example Marked for Index:
            Main Entry:Subentry (b1-m2){ XE "Main Entry:Subentry (b1-m2)" \t "" }
    When it was only a page of content it was no big deal to select the entire line and <Ctrl>+<Alt>+<x> then <Enter> down the line.  Now that I have about 500 lines of these word combinations, I need a more automated solution. 
    I have searched for KB articles that explain the various elements I need, though unsuccessfully since I don’t know what I need.  I doubt I am the first person to do this, so if anyone could point me to the right documents I would greatly appreciate
    it.
    As a noob, how difficult of a task is this to automate with a Macro or some other method and should I even attempt it? I have a very short window of time to figure this out.
    Nice to have: In the final index, I don't need the Word page numbering after the term.  My references are in the parenthesis.  I know how to remove it manually in Word, when I mark the index entry: Chose Options, Cross-reference
    and remove the pre-populated text of "see". That adds  \t "" to the index reference. 
    Illustrated as such:
            From: Main Entry:Subentry (b1-m2){ XE "Main Entry:Subentry (b1-m2)" }
            To:     Main Entry:Subentry (b1-m2){ XE "Main Entry:Subentry (b1-m2)" \t "" }
    My Attempt at Recording a Macro
    Having zero experience writing macro’s myself, I tried recorded a simple macro using the manual keystrokes below however the text reflected in the actual index reference does not change.  I also have to manually kick off the macro on every line of text.
    I walked through each of the steps outlined below as I was recording a macro, however when I replay the macro, the index itself contains the exact same text for every line and does not match the original text on the new line.
    I could not get the macro to repeat itself on every line.  I had to keep running it until I was done (technically, when I realized it was repeating the same text within the index reference itself) but I’d like the macro to run from beginning
    to end; line by line and then insert the Index itself at the end on a new page.
    I realize I need some kind of loop to keep the macro going line by line.
    I also need some way to mark the Main Entry within the loop (everything to the left of the colon) and then the Subentry (everything to the right of the colon to the end of the line). 
    Example “Index” Macro
    Sub Index()
    ' Index Macro
        Selection.EndKey Unit:=wdLine, Extend:=wdExtend
        ActiveWindow.ActivePane.View.ShowAll = True
        ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, Entry:= _
            "TV\:The Good Wife (y2014-y2015)", EntryAutoText:= _
            "TV\:The Good Wife (y2014-y2015)", CrossReference:="", _
            CrossReferenceAutoText:="", BookmarkName:="", Bold:=False, Italic:=False
        Selection.MoveRight Unit:=wdCharacter, Count:=1
    End Sub
    Manually Marking Index Entries
    Manually, here are the keystrokes I use to iterate my way through the document.
    Manual Index Marking Keyboard Combinations:
    At the beginning of the first line, press <Shift> + <End>
    This selects the entire rows text
    Then press <Ctrl> + <Shift> + <x>
    This allows me to “Mark Index Entry”
    Then press <Enter>
    This confirms the Index entry
    Then press <Esc>
    This closes the “Mark Index Entry”
    Go to the next line and repeat.
    Replacing anchor
    Once the creation of each index is complete, I need to be able to iterate through the document and find all anchor + colons (IE: \: ) and replace with colon (IE: :). This way, the “Main entry” and “Subentry” are handled properly when the Index is inserted.
    Manual Anchor Replacement Keyboard Combinations:
    At the beginning of the Word document, press <Ctrl> + <h>
    Find what:      \:
    Replace with:   :
    Then <Alt> + <a>
    Press the "Ok" button (or make replace silent somehow)
    Then press <Esc>
    This should close the "Find and Replace" screen
    Inserting Index
    Ideally, I would like the macro to create and insert the newly marked content into an index at the end of the document.
    Manually Inserting Index Keyboard Combinations:
    Press <Ctrl> + <End>
    this takes us to the bottom of the document
    Then press <Alt> + <s>
    this chooses the "References" tab
    Next press <Alt> + <x>
    this chooses "Insert Index"
    Next press <Alt> + <t>
    This should allow you to choose a "Format" option for the index
    Next press <m>
    This should chose "Modern" from the "Formats" options
    Finally, press <Enter>
    End the macro
    Example before Indexing:
              TV:The Good Wife (y2014-y2015)
              TV:Phineas and Ferb (y2011)
              TV:Curb Your Enthusiasm (y2011-y2015)
              Game:Back to the Future (y2012)
              Made for TV Movie:The Magic 7(y2009)
              Main Entry:Subentry (b1-m2)
    Example after Indexing is completed:
    The marked up text/references did not transfer over properly from the Word document I copied my question from.  I had to manually type the text within the {} brackets for illustrative purposes here:
              TV:The Good Wife (y2014-y2015){ XE "TV:The Good Wife (y2014-y2015)" }
              TV:Phineas and Ferb (y2011){ XE "TV:Phineas and Ferb (y2011)" }
              TV:Curb Your Enthusiasm (y2011-y2015){ XE "TV:Curb Your Enthusiasm (y2011-y2015)" }
              Game:Back to the Future (y2012){ XE "Game:Back to the Future (y2012)" }
              Made for TV Movie:The Magic 7(y2009){ XE "Made for TV Movie:The Magic 7(y2009)" }
              Main Entry:Subentry (b1-m2){ XE "Main Entry:Subentry (b1-m2)" }
    Example Index 
    G
        Game
              Back to the Future (y2012) · 2
    M
        Made for TV Movie
              The Magic 7(y2009) · 2
        Main Entry
              Subentry (b1-m2) · 1,
    2
    T
         TV
              Curb Your Enthusiasm (y2011-y2015) · 2
              Phineas and Ferb (y2011) · 2
              The Good Wife (y2014-y2015) · 2
    Chris Schurman

    Once I combined my Excel knowledge and Word knowledge, this became a piece of cake.  Sharing my solution for anyone else who may have the need.  The point of this exercise is to prepare for an open book exam and I need a quick index of my books
    (there are 6 for this class).  Anyway, here is how i solved (though slightly clunky, it works in seconds!)"
    In Excel, I pieced the text together by concatenating the indexing markup and the contents of the pertinent cells as such:
        =CONCATENATE("XE """,A2,":",B2," (b",C2,"-p",D2,")"" \t """"")
    Content from Excel (with results of concantenate statement in last column:
    Heading    Slide Title    Book    Page    Copy this into notepad then into word
    Game    Back to the Future    1    12    XE "Game:Back to the Future (b1-p12)"
    Made for TV Movie    The Magic 7    2    7    XE "Made for TV Movie:The Magic 7 (b2-p7)"
    Main Entry    Subentry    3    48    XE "Main Entry:Subentry (b3-p48)"
    TV    Curb Your Enthusiasm    4    100    XE "TV:Curb Your Enthusiasm (b4-p100)"
    TV    Phineas and Ferb    5    20    XE "TV:Phineas and Ferb (b5-p20)"
    TV    The Good Wife    6    35    XE "TV:The Good Wife (b6-p35)"
    Then I paste special the "Values" of the last column into Word.
    I run the macro below (haven't figured out how to loop yet) a few doxen times an insert the index at the bottom.
        Sub Index()
        ' Index Macro
            Selection.HomeKey Unit:=wdLine
            Selection.EndKey Unit:=wdLine, Extend:=wdExtend
            Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
            Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
                PreserveFormatting:=False
            Selection.EndKey Unit:=wdLine
            Selection.MoveRight Unit:=wdCharacter, Count:=1
        End Sub
    Bam; instant Index!
    Chris Schurman

  • Macro to colour tasks in team planner

    Hi Everyone,
    I have experience of writing macros for excel and the general format for such things but I dont know where to strat in Project 2010.
    What Im trying to do is write a macro so that if the task name has "collect" in it, its red and if it has "deliver" in it its coloured red.
    I have flags that do this for me in the gantt view so I could reference back to that I guess.
    Can you help?
    Thanks
    Alex

    cossie2know,
    It sounds like red is your color of choice.
    Unfortunately Project doesn't make this as easy as it may seem. In order to use the SegmentFillColor Method in the Team Planner view, the user must manually select the resource assignment. There appears to be no way to automate the selection in that view.
    You could write a macro that found all the desired tasks and then create a resource filter for each of those tasks and apply that filter to the Team Planner view but you would still have to manually select those resource assignments that you wanted to color
    code.
    Not what you wanted to hear, but that's how it works, or in your case, doesn't work.
    John

  • How to call excel macros programmatically in C#?

    Hi,
    I have a requirement where i need to call excel (2003) macros in C# program. Can anyone help me with a code snippet to do the same?
    The excel macro function takes two input parameters? how can the parameters be passed?
    Any code snippet to do the same in C# would be helpful.
    Thanks.

    Hey there, Sid.  I am tryin gto run your code, but I couldn't even gte it to fire.  Here's what I ahve now:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Excel = Microsoft.Office.Interop.Excel;
    namespace WindowsFormsApplication2
        public partial class Form1 : Form
            private void button1_Click(object sender, EventArgs e)
                //~~> Define your Excel Objects
                Excel.Application xlApp = new Excel.Application();
                Excel.Workbook xlWorkBook;
                //~~> Start Excel and open the workbook.
                xlWorkBook = xlApp.Workbooks.Open("C:\\Users\\Ryan\\Desktop\\Coding\\Microsoft Excel\\Work Samples\\Work Samples\\Historical Stock Prices.xlsb");
                //~~> Run the macros by supplying the necessary arguments
                xlApp.Run("ShowMsg", "Hello from C# Client", "Demo to run Excel macros from C#");
                //~~> Clean-up: Close the workbook
                xlWorkBook.Close(false);
                //~~> Quit the Excel Application
                xlApp.Quit();
                //~~> Clean Up
                releaseObject(xlApp);
                releaseObject(xlWorkBook);
            //~~> Release the objects
            private void releaseObject(object obj)
                try
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
                    obj = null;
                catch (Exception ex)
                    obj = null;
                finally
                    GC.Collect();
    When I hit the play button nothing happens.  When I hot F5 nothing happens.  Do you ahve any idea what I'm doing wrong.  I'd appreciate any advice with this!! 
    Thanks!!
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • BPM Collect Pattern:File to IDoc

    Hi,
    My scenario is File to Idoc. An invoice excel file will be sent by the vendor.The excel has a built in macro, which converts the excel to a csv file and file is placed in a file share server.
    *Logic of Macro: *
    There will be a button in the excel file containing macro. In one excel file there would be multiple invoices that contains different number of item lines, The macro checks the u2018Invoice Numberu2019, lines with the same invoice number will be saved in one CSV file. So for example a excel file contains 5 invoices, when press the button that contains the macro, there will be 5 CSV files created under the same path, each CSV file contains one invoiceu2019s information.
      After this I have to post the Inovices in to SAP using an IDoc.
    So, I am using BPM collect pattern to achieve this. In the collect pattern,  I see a correlation defined on one of the source fields,  What does correlation exaclty do in my  case. Let's say I have defined a correlation on Source field called Invoice number.
    BTW I am using FCC on the filed adapter to change the CSV(Invoice) to xml
    Thanks,
    Kiran

    Hi
    to use Xpath for your receiver det. ref these blogs;
    a combination of logics should help you in this case ...
    Customise your 'XPATH' Expressions in Receiver Determination
    XPath to show the path (Multiple Receivers)
    File to Multiple IDocs (XSLT Mapping)
    Try removing BPM from ur scenario.
    1:n could be achieved without BPM
    Various multi-mappings and Optimizing their Implementation in Integration Processes (BPM) in XI.
    Regards,
    Suryanarayana

  • Creating a Macro with Adobe Acrobat X v.10.0.0 HELP!

    Hello,
    I am new to Adobe and was wondering if there is a way to create a macro for my situation.
    I am recording voting decisions from a pdf into an excel spreadsheet. I need to go through multiple pdf files and find the pages where votes have taken place. The picture below shows a vote circled in red.
    I then need record the following information:
        1) The number of 'yes' votes and the number of 'no' notes
        2) The names of the people who voted yes and the names of the people who voted no
        3) The pdf page number of the vote
    I would like to compile of the information in an excel file if possible for later use in statistics software (spss).
    There are hundreds of individual votes I need to record and would love it if someone can help guide me in creating a macro for tedious project.
    Thank you!!

    With Reader no. This is the Reader forum. If you have a properly designed form, you can collect the data from the forms and export the data into a spreadsheet. The best way to do this is to host the form on the web. If you wish forms information returned by email, you will be limited to the number of responses you can process if you have them return the entire form. But if you have them return and fdf or xfdf there is no limit to the number of responses you will be allowed to process.

Maybe you are looking for