vamsi_vajjah
May 8th, 2009, 01:24 AM
Cannot implicitly convert type 'ES.ExcelService' to 'Microsoft.Office.Excel.Server.WebServices.ExcelService'
'Microsoft.Office.Excel.Server.WebServices.ExcelService' does not contain a definition for 'Credentials'
I get the above errors when i was working on Excel Services.
The complete code is as follows,
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.SharePoint;
using Microsoft.Office.Excel.Server;
using Microsoft.Office.Excel.Server.Udf;
using Microsoft.Office.Excel.Server.WebServices;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ExcelService excel = new ES.ExcelService();
excel.Credentials = new System.Net.NetworkCredential("Vamsi", "Password1");
Status[] stati;
string sessionID = excel.OpenWorkbook("http://moss:45939/First Site/Second Site/Work Order/Daily Cash.xls","en-US","en-US",out stati);
object o = excel.GetCellA1(sessionID, "CASHRECT", "A5", true, out stati);
Response.Write(o.ToString());
excel.SetCellA1(sessionID, "CASHRECT", "A5", 3,out stati);
o = excel.GetCellA1(sessionID, "CASHRECT", "A5", true, out stati);
Response.Write(o.ToString());
excel.Dispose();
}
}
Also how to make a row non editable in excel using Sharepoint and Asp.Net.
Hoping for a reply soon.
'Microsoft.Office.Excel.Server.WebServices.ExcelService' does not contain a definition for 'Credentials'
I get the above errors when i was working on Excel Services.
The complete code is as follows,
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.SharePoint;
using Microsoft.Office.Excel.Server;
using Microsoft.Office.Excel.Server.Udf;
using Microsoft.Office.Excel.Server.WebServices;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ExcelService excel = new ES.ExcelService();
excel.Credentials = new System.Net.NetworkCredential("Vamsi", "Password1");
Status[] stati;
string sessionID = excel.OpenWorkbook("http://moss:45939/First Site/Second Site/Work Order/Daily Cash.xls","en-US","en-US",out stati);
object o = excel.GetCellA1(sessionID, "CASHRECT", "A5", true, out stati);
Response.Write(o.ToString());
excel.SetCellA1(sessionID, "CASHRECT", "A5", 3,out stati);
o = excel.GetCellA1(sessionID, "CASHRECT", "A5", true, out stati);
Response.Write(o.ToString());
excel.Dispose();
}
}
Also how to make a row non editable in excel using Sharepoint and Asp.Net.
Hoping for a reply soon.