![]() |
|
#2
|
|||
|
|||
|
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
|
|
|
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 |
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 |