Open an Exel Macro Enabled Worksheet

Status
Not open for further replies.

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Here is code that opens a word document from Outlook 2007. How can we change it to open a Excel Macro Enabled Worksheet?

Public Sub OpenOutlookNoteTableOneColumn()
Dim oWord As Word.Application
Set oWord = CreateObject("Word.Application")
oWord.Documents.Open ("C:\Users\Name\AppData\Roaming\Microsoft\Templates\WordDocumentName.docm")
With oWord
.Visible = True
End With
Set oWord = Nothing
End Sub
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Thank you very much. I did the following and the xlApp.Workbooks.Open line is an error coloring the letter C and saying "expected end of statement"

Public Sub OpenExcel()

Dim xlApp As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.Application.Visible = True
xlApp.Workbooks.Open "("C:\Users\Name\AppData\Roaming\Microsoft\Templates\book1.xlsm")

End Sub
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Thanks so much. It does it perfectly!! PS, just need to finish that If line re the email!!! As you gave me the If line for all the fields in the Contact re the Calendar Event body. Thanks again so much!!
 
Status
Not open for further replies.
Top