Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-09-2015, 09:54 AM
niton niton is offline Starting Excel spreadsheet on Outlook start Windows 7 64bit Starting Excel spreadsheet on Outlook start Office 2010 64bit
Competent Performer
 
Join Date: Jul 2012
Posts: 102
niton is on a distinguished road
Default

It might be quite disturbing to have the file open up every time you send mail.

This goes into the ThisOutlookSession module. It runs when Outlook is started.

Code:
 
Private Sub Application_Startup()
 
    Dim oXLApp As Object
    Dim oXLwb As Object
    Dim oXLws As Object
 
    On Error Resume Next
    Set oXLApp = GetObject(, "Excel.Application")
    If Err.Number <> 0 Then
        Set oXLApp = CreateObject("Excel.Application")
    End If
    On Error GoTo 0
 
    oXLApp.Visible = True
    Set oXLwb = oXLApp.Workbooks.Open("h:\Test\test.xlsx")
    Set oXLws = oXLwb.Sheets("Sheet2")
    oXLws.Select
 
ExitRoutine:
    Set oXLws = Nothing
    Set oXLwb = Nothing
    Set oXLApp = Nothing
 
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Excel spreadsheet calendar data into Outlook 2010 davesp Outlook 0 09-30-2013 09:26 AM
Error when starting Word & Excel mango Word 0 08-15-2013 07:53 AM
Starting Excel spreadsheet on Outlook start Excel stops responding after starting macro Catalin.B Excel Programming 2 09-07-2012 04:05 AM
Is it possible to write down a number starting with zero in excel cell? Rahmat_uk20 Excel 3 06-08-2012 02:26 AM
How do I use an Excel form to populate and Excel spreadsheet apostht Excel 0 05-21-2006 11:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft