Results 1 to 2 of 2

Thread: running windows task

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    43
    I need help with a windows problem. After creating an excel object and closing it I still see an instance of Eccel in the running task window. However I am unable to see it or close it. I have tried using the postmessage, closewindow,and destroywindow method with no results. Any help will be much appreciated.


  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Being as one can't see your code, try this code and see if you get the same problem. On my system, when I quit I quit.
    You need an excel file called myExcel.xls with a macro inside of it call Marco1.

    Code:
    Private Sub Command1_Click()
    'put this code inside the form load event of the Application
    'change the file name and macro name to reflect your file and macro
    'this will open Excel and run the macro
    '
    'create and object (Excel SpreadSheet)
          Dim oXL As Object
          Set oXL = CreateObject("Excel.Application")
          
    ' Open the workbook that contains the macro to run.
          oXL.Workbooks.open "C:\My Documents\myExcel.xls"
    '
    'as object opens invisible, make visible if needed, if not omit
    'the line oXL.visible=true
    '
          oXL.Visible = True
    '
    ' Run the macro.
          oXL.Application.Run "myExcel.xls!Macro1"
    '
    ' Quit Microsoft Excel.
          oXL.Quit
    '
    ' Free the object from memory.
          Set oXL = Nothing
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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