• Adding to GRUSRGAL.GRA (Office 2000/XP)

    Author
    Topic
    #418182

    I have a GRUSRGAL.GRA file which contains chart formatted types that I created, to be sent to other users. However, many of these users do have their own GRUSRGAL.GRA file which contain their own user defined formatting, and there are some users which simply don’t have this file on their pc because they have never made a user defined chart. So I have a dilema which I am not sure how to solve.
    Basically what I want to achieve is this:
    1. Best case scenario take my GRUSRGAL.GRA file and merge it with the other users files
    2. I have a ppt file which includes all the charts that have been added to the GRUSRGAL.GRA file, slide by slide. I could send this ppt file to the users and through a macro (?) all the user defined types will be copied to the other users GRUSRGAL.GRA files (appended basically), so that their original file does not get overwritten.
    If the file does not exist on their computer, it will be created and as in step 2, the chart types will be addedd to the file.
    Is this a realistic request, can this be done – has this already been done at all? I searched in Google for anything relevant about the GRUSRGAL.GRA file, but all I could come up with so far is that apparently the first case scenario is not possible.

    I appreciate any help I can get as I am really stuck with this project and don’t know how to handle it. I also tried to record a macro, but when I get to the chart types/user defined, the macro doesn’t record anything…

    K.

    Viewing 0 reply threads
    Author
    Replies
    • #940370

      I don’t know how you want to name the custom chart types, but the following code will run through all slides in the active presentation, and add the chart assumed to be in the first shape on the slide to the gallery. If the user doesn’t have custom charts yet, the file will automatically be created, otherwise, the charts will be added.

      Sub AddCustomCharts()
      Dim i As Integer
      For i = 1 To ActivePresentation.Slides.Count
      ActivePresentation.Slides(i).Shapes(1).OLEFormat _
      .Object.Application.AddChartAutoFormat "MyName" & i
      Next i
      End Sub

      This macro will name them simply MyName1, MyName2, etc.

      • #940375

        Thanks a lot for your quick reply. I ran the macro, and it added the very first chart, however it stopped there. I am attaching here a sample ppt file, maybe it is easier to see why it doesn’t continue?
        Just a thought on the names, is it possible to give the chart types particular names, rather than the one specified in the macro, so that the users when they work on their own presentations and want to quick-format their own chart, will know which custom type to select from available names (ex. ‘trended line’ if it’s a line chart, ‘pie’ if it’s a pie chart, etc)

        Thanks again,
        K.

        • #940378

          Try this:
          – Select all slides.
          – Change the slide layout to Title and Content.
          – Set the title for each slide to the name you want the custom chart to have.
          – Change the macro to the following:

          Sub AddCustomCharts()
          Dim i As Integer
          For i = 1 To ActivePresentation.Slides.Count
          With ActivePresentation.Slides(i).Shapes(1).OLEFormat.Object.Application
          .AddChartAutoFormat _
          ActivePresentation.Slides(i).Shapes(2).TextFrame.TextRange.Text
          .Quit
          End With
          Next i
          End Sub

          • #940383

            Hans, so far this is perfect! I am sending the file to a few users to test it on their computers, to be sure it works in different environments, and will let you know of the outcome of if they get a problem with it, etc.
            Once again big thanks!
            K.

    Viewing 0 reply threads
    Reply To: Adding to GRUSRGAL.GRA (Office 2000/XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: