简体   繁体   English

从我的功率点图中获取数据点并将其放入Excel工作表

[英]Take data points from my power point graph and put them into an excel sheet

Years ago for a masters project my friend took a bunch of data from an excel sheet and used them in a powerpoint graph. 几年前,我的一个朋友在做一个硕士项目时,从Excel工作表中获取了一堆数据,并在PowerPoint文档中使用了它们。 He told me he made the graph in excel then copied it into powerpoint. 他告诉我他在excel中制作了图形,然后将其复制到了powerpoint中。 Now, when I hover over the graph I see the points associated to where my mouse hovers. 现在,当我将鼠标悬停在图形上时,会看到与鼠标悬停位置相关的点。 My friend lost the original excel sheet and is asking me to help pull the data from the powerpoint graph and put it in an excel sheet. 我的朋友丢失了原始的excel工作表,并要求我帮助从PowerPoint图表中提取数据并将其放在excel工作表中。

How would I go about doing this? 我将如何去做呢? If theres away to get the points into a json file I can do the rest. 如果有将点放入json文件的方法,我可以做剩下的事情。 I just know nothing about powerpoint graphs. 我只是对PowerPoint图形一无所知。

Right click the chart, choose Edit Data. 右键单击图表,选择“编辑数据”。 If it's an embedded chart, the chart and its workbook will open in Excel. 如果是嵌入式图表,则该图表及其工作簿将在Excel中打开。 From there you can File | 从那里您可以File | Save As and save your new Excel file. 另存为并保存新的Excel文件。

years ago I used a program called DataThief - takes a scan of a graph and produces x's and y's according to how many you ask for for resolution. 多年前,我使用了一个名为DataThief的程序-对图形进行扫描,并根据您要求解析的数量生成x和y。 Amazingly it is still around DataThief III and you can find it here: http://datathief.org 令人惊讶的是,它仍然在DataThief III周围,您可以在这里找到它: http ://datathief.org

I'm not sure what this has to do with Python. 我不确定这与Python有什么关系。 Also, I'll bet anything the data is already coming from Excel and it's converted into a PowerPoint slide. 另外,我敢打赌任何已经来自Excel的数据都会被转换为PowerPoint幻灯片。 I doubt it's working the way you described it. 我怀疑它是否按照您描述的方式工作。 Check out the Macro below and see if it helps you with your project. 查看下面的宏,看看它是否对您的项目有帮助。

Sub Open_PowerPoint_Presentation()

Dim objPPT As Object, _
    PPTPrez As PowerPoint.Presentation, _
    pSlide As PowerPoint.Slide

Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Set PPTPrez = objPPT.Presentations.Open("C:\PPT_Deck.pptx")
Set pSlide = PPTPrez.Slides(5)

If pSlide.Shapes.Count <> 0 Then
    'Table
    ActiveWorkbook.Sheets("Sheet1").Range("Named Range").Copy
    pSlide.Shapes.PasteSpecial DataType:=ppPasteEnhancedMetafile
    'OR
    ActiveWorkbook.Sheets("Sheet1").Range("Named Range").CopyPicture
    pSlide.Shapes.Paste

    'Charts
    ActiveWorkbook.Sheets("Graph1").ActiveChart.ChartArea.Copy
    pSlide.Shapes.PasteSpecial DataType:=ppPasteEnhancedMetafile
    'OR
    ActiveWorkbook.Sheets("Graph1").ActiveChart.ChartArea.CopyPicture
    pSlide.Shapes.Paste
Else
    MsgBox "There is no shape in this Slide (" & pSlide.SlideIndex & ")." & vbCrLf & "Please use a slide with at least one shape, not a blank slide", vbCritical + vbOKOnly
End If

End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM