I tried to find an answer to this question without any success: is it possible to embed an XML file in a xlsx file?
My final objective would be to use this embedded XML file as a data source to generate a table.
View Complete Post
I am trying to simply extract an excel data from an uploaded file an put it into a datatable. In this case the excel file has 3 rows but when I fill the datatable I only see row count of 2.
I tried changing HDR:NO; to HDR:YES and vice versa, but no luck.
What am I doing wrong? (Note: the excel file cannot have a headerrow)
string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + pFilePath + ";Extended Properties=\"Excel 12.0;IMEX=1;HDR:NO;\"";
OleDbConnection conn = new OleDbConnection(connstr);
DataTable dtTables = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null);
string strTablename = dtTables.Rows["TABLE_NAME"].ToString();
string strSQL = "SELECT * FROM [" + strTablename + "]";
OleDbCommand cmd = new OleDbCommand(strSQL, conn);
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
//At this point row count=2 which doesn't make sense
I am seriously loosing hair over this one! I have successfully used OPENROWSET to query data in an Excel 2003 file (*.xls) in SQL Server, however I am now looking to replicate this functionality with an Excel 2007 (*.xlsx) file.
I have tried the usual google searches but nothing concrete seems to come up, can anyone give me any pointers?
My Excel 2003 file sql is as follows: (works great)
I am unable to open an excel file in Sharepoint (MOSS 2007). All other documents work fine. As far as I know there was no change on the Server at all.
Excel found unreadable content in 'stuff.xls'. Do you want to recover the contents of this workgroup? If you trust the source of this workbook , click Yes
When I click YES >> It says "Excel recovered your formulas and cell values, but some data may have been lost." And then a link to an xml file , which reads :
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<summary>Errors were detected in file 'http://server_name/Project_name/Shared Documents/abc - def/Phase 5/Track/stuff.xls'</summary>
<info>Excel recovered your formulas and cell values, but some data may have been lost.</info>
Now this has resulted in huge loss of data and I can see New numbers in the cells which is very strange!
Is there a way I can get it back ? I do not have a
I have installed microsoft sharepoint portal server 2007.
In which I specify in one document library excel template. I upload template of excel 2010
if OFFICE 2007 is installed in my system or in other persons . then it will open a template in excel document . but I update office and now office 2010 installed in my system. now when i click a new button and open a excel document . it is not opening
and open only a text file with garbage. and show a dialog box with message.
"The document could not be created.
The required application may not be installed properly, or the template for this document library cannot be opened."
How can I open a template in office 2010 with MOSS 2007 document library.
Kindly tell me the solution as soon as possible.
i am in need to read an excel 2007 file from C# on 64 bit windows 7 ultimate machine. Please help me out to find an optimum solution to it. I have got an option to change the project settings to 'x86' from 'Any CPU', however i dont want to do this since
these are NUnit assemblies and would be running on 64 bit windows 7 server only.
i hope i clearly mentioned my problem, if more information is needed please feel free to ask.
we want to embed a xls file with macro in web page, and execute the macro when users click the button in xls file.
i do it by using iframe as following,
<IFRAME WIDTH="75%" HEIGHT="55%" NAME="fframe" SRC="Calculator.xls"> <FRAME WIDTH="75%" HEIGHT="55%" NAME="fframe" SRC="Calculator.xls"> <EMBED SRC="Calculator.xls" width=200 height=100></IFRAME>
When I open this web page via IE, it will prompt me to open or save the xls file.
We want IE open it directly, but i do not know how to do it.
Dose someone can help me?
Thank you very much.
I have two columns with id,name in the excel sheet.I want to convert into xml file in the below format
<?xml version="1.0" encoding="utf-8"?>
<guide xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
suggest me with sample code in ASP.NET.
I have a web app where user uploads a file.
File is saved in server locally and I want to read some data from it.
Currently my development server has office 2003.
So do I need office 2007 in order to be able to read an excel from office 2007 ?
What are other requirements ?
I tried a test, using
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();Microsoft.Office.Interop.Excel.Workbook wrkBook; // = new Microsoft.Office.Interop.Excel.Workbook();wrkBook = excelApp.Workbooks.Open(@"C:\www\excel_files\b.xls", ....);
But When trying to open the file I get the error:
Exception from HRESULT: 0x800A03EC
So I'm wondering what I'm missing.
I used the below code to return the datas from one excel file. My question is if i suppose need to get the records from morethan one excel file using joins, how it is possible.
string connString = ConfigurationManager.ConnectionStrings["xls"].ConnectionString;
// Create the connection object
OleDbConnection oledbConn = new OleDbConnection(connString);
// Open connection
// Create OleDbCommand object and select data from worksheet Sheet1
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
// Create new OleDbDataAdapter
OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
// Create a DataSet which will hold the data extracted from the worksheet.
DataSet ds = new DataSet();
// Fill the DataSet from the data extracted from the worksheet.
I want to develop an application which supports Server Side Excel Automation using a template(xltx). I am able to acheive most of the automation except(using excelpackage.dll - OfficeOpenXml), i am stuck up identifying the checkbox controls in my excel work sheet.
Any help on this is really appreciated.
My sample code.
I am using ASP.NET and C# 2.0 and working on web application.
I want to embed a word document inside a excel sheet.
How to embed word document inside excel.
I am using .net version 1.1 and excel 2003 to display data.I need to display data in 2007 .Can anyone suggest the reference to be added ,connection string change and what should be imported.
I'm trying to import (Custom Lists >> Import Spreadsheet) into WSS 3.0 and I'm getting the following message:
Refers to the _layouts
You are not authorized to view this page. You might not have permissions to view this direcotyr or page using the credentials you supplied. [More stuff here.]
Http ERror 403 - Forbidden
Is this just a permissions problem or is there some other underlying issue? Should you be able to upload an Excel spreadsheet (with links) into a Custom List?
we receive error while trying to create excel sheet using the template we have uploaded on the SharePoint 2007.
This occurs on a machine that has Office 2010 installed. Earlier the machine had Office 2007 and everything was working fine.
Can you let me know why is problem is coming and how to resolve this.
when i am trying to save a excel document in library it getting error like "The file cannot be saved because some properties are missing or invalid"
If anyone know the solution for this pls tell me.