Do you have any requirements to generate online Excel form from server without Office installed?
Why not download DSOFile from Microsoft website?
The Dsofile.dll files lets you edit Office document properties when you do not have Office installed
Sample Code in C#:-
DSOFile.OleDocumentPropertiesClass d = new DSOFile.OleDocumentPropertiesClass();
string file = Server.MapPath(@"Files\I9.xls");
d.Open(file, false, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);
foreach (DSOFile.CustomProperty cp in d.CustomProperties)
{
if (cp.Name == "Name")
{
object objValue = "YB test on " + DateTime.Now;
cp.set_Value(ref objValue);
}
}
d.Save();
d.Close(true);
System.Runtime.InteropServices.Marshal.ReleaseComObject(d);
Response.Write(file + " [Name] field has been updated successfully");
No comments:
Post a Comment