open a excel window and display the values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ravindarjobs
    New Member
    • May 2007
    • 86

    open a excel window and display the values

    hello friends,

    i am using ms access 2003,
    i have a form,
    when i click on a button, i should get the new excel window opened, displaying a particular table present in my access database.

    so i went through this code

    Dim oExcel As Excel.Applicati on
    Dim oWB As Excel.Workbook
    Dim oWs As Excel.Worksheet
    Set oExcel = New Excel.Applicati on
    'Set oWs = Excel.Worksheet s.Application.A ctiveSheet
    Set oWs = Excel.ActiveShe et
    oExcel.Visible = True
    Set oWs = oExcel.ActiveSh eet

    i am not sure of this. i am struck here.
    what should i do next

    is this the correct way to proceed?
    or else is there any easy way?
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by ravindarjobs
    hello friends,

    i am using ms access 2003,
    i have a form,
    when i click on a button, i should get the new excel window opened, displaying a particular table present in my access database.

    so i went through this code
    Code:
    Dim oExcel As Excel.Application
    Dim oWB As Excel.Workbook
    Dim oWs As Excel.Worksheet
    Set oExcel = New Excel.Application
    'Set oWs = Excel.Worksheets.Application.ActiveSheet
    Set oWs = Excel.ActiveSheet
    oExcel.Visible = True
    Set oWs = oExcel.ActiveSheet
    i am not sure of this. i am struck here.
    what should i do next

    is this the correct way to proceed?
    or else is there any easy way?
    Greetings and salutations, ravindarjobs!

    It looks like you are not loading your MS access data to VB. Should you have added data from Access to Excel first?

    Or are you saying data are alreayy added and you just need to view?

    Comment

    Working...