-
Oct 18th, 2017, 06:58 AM
#1
Thread Starter
Member
Create Object Issue
I'm struggling with this function!
This all worked fine, until we upgraded to Office 365.
Now, this:
Code:
Dim oApp As Object
Set oApp = CreateObject("Word.Application") 'This works, and starts a Word document session.
Set oApp = CreateObject("Outlook.Application") 'This doesn't work, error 429
If Err = 429 Then
Set oApp = GetObject(, "Outlook.Application") 'Nor does this, same error
End If
I tried using Early binding, but that made no difference.
Even with a reference to Microsoft Office 16 Object Library, the statement "Dim oApp as Outlook.Application" isn't recognised.
Is there some other way of referencing Outlook 2016?
-
Oct 19th, 2017, 04:21 AM
#2
Re: Create Object Issue
you may need to prompt the user to start outlook, then getobject should work (maybe)
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Oct 19th, 2017, 04:52 AM
#3
Re: Create Object Issue
I have seen this when you run your program from the IDE (Windows 10 and the IDE is running elevated)
When compiled and running as a normal user the program does work.
Excel and Word can be started from an elevated process, it seems that Outlook behaves different
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|