Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exporting to Power Point

    Hi Everyone,

    I have a panel data consisting of stock prices for 10 years. I want to get graph of each stock's price history by using "tsline" command. I wrote a loop for this and achieve it as a Stata image file. However, my aim is to create a PowerPoint file that has unique stock price history on every page. For example, I have 50 stocks so I want to create a PowerPoint file with 50 pages. Is it possible to do this? Thank you very much for your suggestions in advance.

    I wish everyone a happy new year.

    Best,
    Ulas

  • #2
    See here: https://www.stata.com/statalist/arch.../msg00353.html

    Comment


    • #3
      It's also worth noting that .pptx files are just zipped files with all of the necessary files for PowerPoint to assemble the file (e.g. just rename .pptx to .zip and then unzip to see all of the files). You could use this to hack out a solution if it's something that you need to do often.

      For example, saving the attached ado-file (graphs2ppt.ado) into your working directory can be used to create slides from graphs stored in Stata's memory with their name in the slide's title. Example:

      Code:
      clear all
      sysuse tsline2
      tsset day
      
      tsline calories, name(calories) nodraw
      tsline ucalories lcalories, name(range) nodraw
      
      graphs2ppt calories range using slides, replace
      I have only tested this on Stata 14.2 and Windows 10 with PowerPoint 2016. I can't say if it will work beyond that.

      Regardless, it's a proof-of-concept for how to approach something similar if you like. You could modify the programming to use any PowerPoint layouts, themes, etc. that you like. If you make the relevant changes in a basic PowerPoint file and then inspect the changes made in the zipped xml files, then you can generally figure out what's needed. There is also plenty of documentation available online.
      Attached Files

      Comment

      Working...
      X