Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 20th, 2006, 10:49 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pasing parameters to Spreadsheet

I have a gridview and I want to be able to pass the values from the gridview to an existing excel document. I want to be able to use the Excel object model. So far I have managed to open my existing document but I havent figure out how to pass the values. ANy suggestions? Thank you

 protected void BtnAnalysis_Click(object sender, EventArgs e)
    {
        Microsoft.Office.Interop.Excel.Application m_objExcel;
        Microsoft.Office.Interop.Excel._Workbook m_objBook;
        Microsoft.Office.Interop.Excel.Workbooks m_objBooks;
        Microsoft.Office.Interop.Excel.Sheets m_objSheets;
        Microsoft.Office.Interop.Excel._Worksheet m_objSheet;
        Microsoft.Office.Interop.Excel.Worksheets ExcelWorkSheets;
        Microsoft.Office.Interop.Excel.Font m_objFont;

        m_objOpt = System.Reflection.Missing.Value;
        m_objExcel = new Microsoft.Office.Interop.Excel.Application();
        m_objBooks = (Microsoft.Office.Interop.Excel.Workbooks)m_objExc el.Workbooks;
        m_objBook = (Microsoft.Office.Interop.Excel.Workbook)(m_objBoo ks.Add(m_objOpt));
        m_objExcel.Visible = true;



        string workbookPath = "c:/BillingAnalysis.xls";
        m_objBook = m_objExcel.Workbooks.Open(workbookPath,
            0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindow s, "",
            true, false, 0, true, false, false);



        }




}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Spreadsheet Help SteveV VBScript 0 October 10th, 2006 04:42 PM
Excel Spreadsheet Help SteveV BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 October 10th, 2006 04:41 PM
Excel Spreadsheet Help SteveV BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 October 10th, 2006 04:40 PM
Pasing parameters to Spreadsheet Azhavee grajeda Access VBA 2 September 22nd, 2006 11:15 PM
Export a spreadsheet Corey Access 0 November 22nd, 2005 03:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.