-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Soumitra2105
Message 3 in Discussion

Hi,
Open Code 

        #region Comments for Open()
        public void Open(string fileName)
                {
                app = new Application();
                if (app == null) 
                return;
                //app.Visible = true;
                Workbooks workbooks = app.Workbooks;
                workbook = workbooks.Open(fileName, 0, true, 5,"", "", true,
Excel.XlPlatform.xlWindows, "\t", false, false, 0, true);
                Sheets sheets = workbook.Worksheets;
                // The active sheet concept is not being considered
                // Get the Data Sheet (typically first sheet)
                dataSheet = (_Worksheet) sheets.get_Item(1)
                }

        #endregion


Close Code 

#region Comments for Close()
                public void Close()
                {
                        try 
                        {
                                // If user interacted with Excel it will not
close when the app object is destroyed,                                 so
we close it explicitely
                                workbook.Saved = true;
                                app.UserControl = false;
                                app.Quit();
                        } 
                        catch (COMException) 
                        {
                        }
                        return;
                }

Warm Regards,

Soumitra 



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to