Results 1 to 3 of 3

Thread: [RESOLVED] calll Excel from VB

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Resolved [RESOLVED] calll Excel from VB

    Hi

    I Build a Excel File using VB as below

    Code:
    '--------------------'
        '  Instancia Excel   '
        '--------------------'
        Set objXl = CreateObject("Excel.Application"): objXl.Visible = False
        '--------------------'
        ' Abre Novo Arquivo  '
        '--------------------'
        Set objBook = objXl.Workbooks.Open(sNovo_Arquivo, , , , "")
        Set objSheet = objBook.ActiveSheet
    
        objSheet.Cells(4, 1).CopyFromRecordset rsEvento ', 65536
    
        '-------------------------
        ' Salva planilha
        '------------------------
        Set objSheet = Nothing
        objBook.Close SaveChanges:=True
        Set objBook = Nothing
        objXl.Quit
        Set objXl = Nothing
    I tried to open excel using shell
    Code:
       shell sNovo_Arquivo
    Is there other way to open Excel without to let excel object opened inside VB ?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: calll Excel from VB

    Shell only runs applications.

    To open a file, use ShellExecute. For more information, see the article How do I open a file/web-page in its default application? from our Classic VB FAQs (in the FAQ forum)

  3. #3

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: [RESOLVED] calll Excel from VB

    thank you

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