Results 1 to 3 of 3

Thread: Excel file processing

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90

    Question

    Where can I find some useful sample or reference on how to process an 97 Excel file. eg. I need the common commands for readings, retreiving, moving around the worksheet and write back to this Excel file. It is fairly easy on an Access .mdb but what about Excel?

    Regards


    CT

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    First, add Microsoft Excel to your project references. The code following this will get you started. The best way to learn how to manipulate data is to turn you macro recorder on, do what you want to learn how to do, and then look at the recorded macro. To use this code, just add the prefix for your Excel object to their code.


    Private Sub Command1_Click()

    Dim xlApp As Excel.Application
    Set xlApp = CreateObject("Excel.Application")

    Dim xlWS As Excel.Worksheet

    xlApp.Workbooks.Open "Path and Name"
    Set xlWS = xlApp.ActiveWorkbook.Worksheets.Item(1)

    ' Do what you want to do here

    xlApp.Workbooks.Close
    xlApp.Quit
    Set xlWS = Nothing
    Set xlApp = Nothing

    End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90
    Thank you HDR


    Regards
    CT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width