excel work book open funtion

Posted by Vijay.Kumar under C# on 8/29/2012 | Points: 10 | Views : 897 | Status : [Member] | Replies : 3
please help in excel work book method where explain about workbookopen method




Responses

Posted by: Gopesh9 on: 8/29/2012 [Member] Starter | Points: 25

Up
0
Down
I dont know much about this, but it helps you to open a work book. The syntax of that is
expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)

You can have a look to this msdn site, may this can help you...
http://msdn.microsoft.com/en-us/library/office/bb179167(v=office.12).aspx

G. S.
.Net Developer

Vijay.Kumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Srilu.Nayini577 on: 8/29/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Excel.Workbook wbook = null;

Excel.Worksheet wsheet = null;

Excel.Range range = null;

app.Visible = false;

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

string filepath = textBox1.Text;

if (filepath != "")
{

wbook = app.Workbooks.Open(filepath, Missing.Value, Missing.Value, Missing.Value,

Missing.Value, Missing.Value, Missing.Value,

Missing.Value, Missing.Value, Missing.Value,

Missing.Value, Missing.Value, Missing.Value,

Missing.Value, Missing.Value);


string currentSheet = "Sheet1";

wsheet = (Excel.Worksheet)wbook.Worksheets.get_Item(currentSheet);

range = wsheet.get_Range("A7", "F7");

System.Array myvalues = (System.Array)range.Cells.Value2;

/*Here you can convert values as you required*/



}


It works fine.

Thank you,

SRILATHA
.Net Developer

Vijay.Kumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Srilu.Nayini577 on: 8/29/2012 [Member] Starter | Points: 25

Up
0
Down
In that app is nothing bt :

Excel.Application app = new Excel.Application();

SRILATHA
.Net Developer

Vijay.Kumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response