Hi,
I have a some information i.e. is in Table format in Excel
I want to insert that Table into power point
using C#
how do i do that
Please help
i've also added the snap shot of table
thank you
7 7416
What have you coded/tried so far? Please so use what you are trying right now along with any error/exception you are getting.
Here is the code
that i've been using
i'm able to insert the data into excel
now after inserting those data
i want to bring that whole table in power point
something like ChartObject
thank you
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Just copy/paste your code for extracting the table, along with the error message you are getting. Don't attache a file of your entire project. Just the code that is giving you trouble.
Here is the code - protected void CreatePowerPointSlideFromExcelTemplate()
-
{
-
excelApp = new Excel.Application();
-
-
excelApp.Visible = true;
-
string templatePath = MapPath("ChartTemplate.xlsx");
-
-
object missing = System.Type.Missing;
-
-
Excel.Workbook objWorkbook = excelApp.Workbooks.Open(templatePath, missing);
-
-
-
Excel.Worksheet wSheetTest = (Excel.Worksheet)objWorkbook.Sheets["testTable1"]; //test Table
-
-
-
// HERE I WANT TO CAPTURE THAT TABLE IN PICTURE AS SOME KIND OF OBJECT // SO THAT I CAN ADD IT IN POWERPOINT SLIDE
-
CreateChartBasedOnEnteredValues(wSheetTest, "testTable");
-
-
-
-
CreateSlideForGraph(CreateChartBasedOnEnteredValues(wSheetTest, "testTable"));
-
-
// Close and release the Excel Workbook object.
-
if (objWorkbook != null)
-
{
-
objWorkbook.Close(false, missing, missing);
-
objWorkbook = null;
-
}
-
-
// Quit Excel and release the ApplicationClass object.
-
if (excelApp != null)
-
{
-
excelApp.Quit();
-
excelApp = null;
-
}
-
-
-
-
}
-
-
-
-
protected CreateTableBasedOnEnteredValues(Excel.Worksheet wSheet, string chartName, string lbl1, string fy1Qtr1, string fy1Qtr2, string fy1Qtr3, string fy1Qtr4, string lbl2, string fy2Qtr1, string fy2Qtr2, string fy2Qtr3, string fy2Qtr4)
-
{
-
Object missing = System.Type.Missing;
-
-
-
wSheet.get_Range("B3", "B3").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
wSheet.get_Range("C3", "C3").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
wSheet.get_Range("D3", "D3").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
wSheet.get_Range("F3", "F3").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
-
wSheet.get_Range("B4", "B4").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
wSheet.get_Range("C4", "C4").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
wSheet.get_Range("D4", "D4").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
wSheet.get_Range("F4", "F4").set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault, "test");
-
-
Excel.ChartObjects chartObjects = (Excel.ChartObjects)(wSheet.ChartObjects(missing));
-
Excel.ChartObject objChart = (Excel.ChartObject)(chartObjects.Item(chartName));
-
-
-
}
-
-
-
-
-
// HERE I WANT TO CAPTURE THAT TABLE IN PICTURE AS SOME KIND OF OBJECT // SO THAT I CAN ADD IT IN POWERPOINT SLIDE
This is not exactly what we here at Bytes consider your own effort to code this, before asking for help.
Its more like you are asking for someone to just give you the code to do it.
Can anybody send me code to [...]
The Bytes volunteers are not here to write your code for you. This is not a free homework service.
Bytes is very much a "Give me a fish I eat for a day. Teach me to fish I eat for a lifetime" kind of place. Just giving you the code doesn't help you learn near as effectively as good old-fashioned trial and error.
Do a little reading up and experimenting then if your trials aren't doing what you expect, post the code and relevant messages/errors and we'll see what we can do to point you in the right direction for making it work.
Try hitting Google with terms of your programming language and primary terms of what you want to do. For example " C# custom events" or " VB datagrid Excel". I've found this to be a very effective tool.
May I suggest - First: Do some research. I heard about thing thing called Google, or books even.
- Second: Do some experiments yourself. You will learn so much from actually trying it before throwing up your hands in defeat before even starting.
- Third: Show the volunteers here the code that you created that was the closest to successful along with relevant errors.
sorry for the inconvenience.
I really appreciate your help and time.
Its not that i've given up
but at this point i'm not able to go any further.
so i had to go other way
i.e. creating table object directly in PowerPoint
but doing this really slows down the performance
For getting that excel table as an object i had done lots of trial and error method
but got no where
thank you
You can use the Open XML Format SDK to move data from one type of office document to another.
There is more information available here: http://msdn.microsoft.com/en-us/library/dd440953.aspx
What is the Open XML Format SDK?
The Open XML Format SDK provides a set of Microsoft .NET Framework application programming interfaces (APIs) that allows you to create and manipulate documents in both client and server environments by using the Open XML Formats without requiring Microsoft Office client applications.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jeff |
last post by:
I will start off by giving you a background of the process I am taking.
The nature of my DTS package is that I recieve an Excel Spreadsheet, run
it through the DTS Package applying validation to...
|
by: cv |
last post by:
Hi all,
I have to copy two set of data from 2 files(notepad/excel) say,
products and their corresponding prices to list/textarea/table. I
should be able to retrieve the product and corresponding...
|
by: Alvin Bruney |
last post by:
anybody know how to launch desktop excel from a webpage and feed it either a
dataset or a file? i've got MS sample code but it aint compiling with the
office 10 library. i wonder if they changed...
|
by: Matthew Wieder |
last post by:
I have the following requirements:
Build a stand-alone C# application that asks the user to click in a cell
in an Excel spreadsheet, and then displays the address of that cell in
the C#...
|
by: Rach |
last post by:
Hi,
Does anyone know how to export charts/graphs from EXCEl
into Powerpoint-Microsoft Charts though VBA code. I would
like to import the underlying data with the chart as well.
I know we can...
|
by: lgbjr |
last post by:
Hello All,
I¡¯m using a context menu associated with some pictureboxes to provide
copy/paste functionality. Copying the image to the clipboard was easy. But
pasting an image from the clipboard...
|
by: yuenli |
last post by:
Hi!
I am using Microsoft Office Interop Power Point to build a Power Point Automation program. Does anyone know how to insert a table in the power point slide using the above object library?...
|
by: Merlin1857 |
last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can...
|
by: Omer |
last post by:
I am trying to create a shared addin using visual studio 2005 with the
following code. It is working only in Power Point Appliction and not loading
in Excel and Word I used the Visual Studio Wizard...
|
by: TG |
last post by:
hi!
I am trying to create a sql server table from an excel sheet.
Here is the code I have:
'This procedure the xlsx file and dumps it to a table in SQL Server
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
|
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...
| |