Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
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
  #2  
Old 06-09-2015, 11:07 PM
NMGMarques NMGMarques is offline Starting Excel spreadsheet on Outlook start Windows 7 32bit Starting Excel spreadsheet on Outlook start Office 2010 32bit
Novice
Starting Excel spreadsheet on Outlook start
 
Join Date: Mar 2014
Posts: 6
NMGMarques is on a distinguished road
Default

Quote:
Originally Posted by niton View Post
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.
Hadn't even considered that. Thanks for pointing it out And the script works perfect. Much thanks!
Reply With Quote
Reply



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 05:15 PM.


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