Hi,
I'm trying to use VBA to extract underlying data from charts in powerpoint to excel, i.e from the underlying powerpoint datasheet that feeds the chart.
I've found the macro below on the net. It copies the data in each chart/datasheet and slide in powerpoint but I'm struggling with the bit to get the data into excel.
Below it I've tried incoporating some code to paste into excel but it does not seem to work.
Hope someone can help.
Thanks,
Lucas -
Sub GetChartData1() 'copies data from sheet
-
Dim s As Shape 'gr As Graph.Chart
-
Dim gr As Object
-
Dim sl As Slide
-
'Copies data from datasheet in powerpoint
-
For Each sl In ActivePresentation.Slides
-
For Each s In sl.Shapes
-
If s.Type = msoEmbeddedOLEObject Then
-
'we have found an OLE object
-
'check if it's a graph
-
If s.OLEFormat.ProgID = "MSGraph.Chart.8" Then
-
'this might vary depending on what version you're using
-
'now get a handle on the graph object itself
-
Set gr = s.OLEFormat.Object
-
gr.Application.DataSheet.Cells.Copy
-
-
End If
-
End If
-
Next s
-
Next sl
-
-
End Sub
-
-
Sub GetChartData2() ' includes code to paste into excel
-
Dim s As Shape 'gr As Graph.Chart
-
Dim gr As Object
-
Dim sl As Slide
-
'Copies data from datasheet in powerpoint
-
For Each sl In ActivePresentation.Slides
-
For Each s In sl.Shapes
-
If s.Type = msoEmbeddedOLEObject Then
-
'we have found an OLE object
-
'check if it's a graph
-
If s.OLEFormat.ProgID = "MSGraph.Chart.8" Then
-
'this might vary depending on what version you're using
-
'now get a handle on the graph object itself
-
Set gr = s.OLEFormat.Object
-
gr.Application.DataSheet.Cells.Copy
-
-
'Paste into excel - this section not working
-
-
Workbooks("test.xls").Sheets("sheet1").Activate
-
Range("B1").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
End If
-
End If
-
Next s
-
Next sl
-
-
End Sub
-
2 6426 Dököll 2,364
Recognized Expert Top Contributor
Greetings, LucasLondon!
Looks like you putin a lot of work into this, great job...
I will send over to our friends in VBA to see what can be salvaged.
Please come back to us if VB 6 is what you needed.
Good luck with the project!
Dököll
Hello Dokoll,
Just to let you know, I'm trying to do this in VBA from within excel or powerpoint and not in a standalone VB application, although of course I understand that VBA and VB are the same language!
Thanks for your effort. Looking forward to seeing some kind of soultion.
Lucas
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: phong.lee |
last post by:
Here is an issue i've been trying to figure out which i do not have an
answer to. Basically i have an excel spreadsheet which has data that
i copy and paste from another resource. I also created an excel object
in a module in access which directly links to the excel spreadsheet.
The data in excel varies from day to day. i.e.(Spreadsheet will have
data from 6/1/05 - 6/4/05 for one day, and it will increase by one day
going forward.) ...
|
by: 333sridhar333 |
last post by:
Hi,
I am having a problem in exporting a data from jsp to excel.
I am getting the values from a servlet and populating it to a JSP.
And form there i export them to Excel.
The functionality works fine. But the problem is with the exported data.
I am having values with leading zeros. for example:
Patron Code
|
by: 333sridhar333 |
last post by:
Hi,
I am having a problem in exporting a data from jsp to excel.
I am getting the values from a servlet and populating it to a JSP.
And form there i export them to Excel.
The functionality works fine. But the problem is with the exported data.
I am having values with leading zeros. for example:
Patron Code
|
by: Sunil Basu |
last post by:
Hi,
I have a interesting thing to know and discuss with you.
I am extracting data from an Excel file in a Delphi DbGrid through SQL. I want to create a criteria on a specific cell value of the excel file. I want to retrieve a record if the value of a particular column in excel say D4 is < 0 where D is the column and D4 the cell value. If this condition is met then we display that record in the Delphi DBGrid.
Is this possible through a...
|
by: runner7 |
last post by:
I used file_get_contents() to read a pdf into a string and then tried
to extract the encoded part between the "stream" and "endstream" words
using the strpos() and substr() functions. (I could not get
preg_match() to work.) The substr() pulled it out, but read past the
length I entered by 12 characters to include "endstream en". Besides
that minor problem, I tried gzuncompress() on the extracted string
which only generated a data error....
| |
by: sgsiaokia |
last post by:
I need help in extracting data from another source file using VBA. I have problems copying the extracted data and format into the required data format. And also, how do i delete the row that is not required in the output file, in the below example: The row, D0, is not needed.
An Example Data Format From the SOURCE file:
W1 W2 W3 W4 Oct05
AverageYield 95% 96% 92% 91% 94%
D0 0.1 ...
|
by: JSagar |
last post by:
Hello Expert !
I am new to python , i had done 'C' Code , which extracted file data , But i don't want to give my exe On remote side.
Following thing is it Possible using python?
- using python i can run my exe OR write Whole code in python which run at client side But extracting data from Server side .
- If not, is their any alternate way?
Waiting for Reply ...
|
by: =?Utf-8?B?YzY3NjIyOA==?= |
last post by:
Hi all,
I have a question for you.
I have a .csv file which has many lines of data.
Each line has many data fields which are delimited by ",".
Now I need to extract part of data from this file but save it as an excel
file.
The data in this excel file will be imported into an Access database. The
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |