Results 1 to 3 of 3

Thread: Displaying New Excel Workbook

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Durham, NC, US
    Posts
    218

    Displaying New Excel Workbook

    I have a VBA project in Word that can create and populate Excel Workbooks and Outlook Messages. I can show the Message to the user when I'm done with it, but I can't figure out how to show the Workbook.

    VBA in a Word project, what is the method to show an Excel Workbook?

    This is the code I use for the Outlook Message.

    VB Code:
    1. Dim objOutlook As Outlook.Application
    2. Dim objOutlookMsg As Outlook.MailItem
    3.  
    4. Set objOutlook = New Outlook.Application
    5. Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
    6.  
    7. 'Fill out Reciepents, Subject, add Attachments here.
    8.  
    9. objOutlookMsg.Display
    10. AppActivate myMessageSubject, True
    Travis, Kung Foo Journeyman

    Web Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.5 Guide and Reference
    Perl: Documentation, Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    OSS: Mozilla, MySQL (Manual)

  2. #2
    Hyperactive Member Granty's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    439
    Code:
    Dim XLApp as Excel.Application
    Dim XLBook as Excel.Workbook
    
    Set XLApp = New Excel.Application
    Set XLBook = XLApp.Workbooks.Open("C:\MyFile.xls)
    
    XLApp.Visible = True
    
    'Do stuff
    
    XLApp.Quit
    Set XLBook = Nothing
    Set XLApp = Nothing

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Durham, NC, US
    Posts
    218
    Thanks. I was looking for some method on XLBook instead of XLApp. That was incredibly frustrating.
    Travis, Kung Foo Journeyman

    Web Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.5 Guide and Reference
    Perl: Documentation, Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    OSS: Mozilla, MySQL (Manual)

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