Making Outlook Appointments

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
ralf_jantschek
Posts: 17
Last visit: Tue May 30, 2023 2:49 am

Making Outlook Appointments

Post by ralf_jantschek »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build:
Operating system:
W10 Version 10.0.19044.2486
PowerShell version(s):
PowerShell Studio 5.8.218

*** Please add details and screenshots as needed below. ***
Hello,
I'm receiving errors while trying create a meeting request in Outlook 365
although everything works fine with
Version PowerShell Studio 5.5.155
which is installed on a different machine.
  1.             $ol = new-object -comObject Outlook.Application
This statement crashes under new Version
  1.             try
  2.             {
  3.                 $calendar = $olNamespace.Folders('XXX)
  4.             }
  5.             catch
  6.             {
  7.                 [void][System.Windows.Forms.MessageBox]::Show("Unable to execute: XXX")

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Making Outlook Appointments

Post by Alexander Riedel »

[Topic moved by moderator]
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Making Outlook Appointments

Post by jvierra »

You say one statement crashes then you show code that does not contain that statement. "Crashes" doesn't tell us anything.

Run the code at a PowerShell prompt to see if you get the same issue.

Running Outlook under a WinForm can also cause issues with the threading model and the architecture between machines.
User avatar
ralf_jantschek
Posts: 17
Last visit: Tue May 30, 2023 2:49 am

Re: Making Outlook Appointments

Post by ralf_jantschek »

Hello,

Maybe I posted tooo much Code:
  1. $calendar = $olNamespace.Folders('XXX)
This is the Code in question.

anyway, thanks for the answer
User avatar
ralf_jantschek
Posts: 17
Last visit: Tue May 30, 2023 2:49 am

Re: Making Outlook Appointments

Post by ralf_jantschek »

Hello Group,
unfortunately this problem persits...
Is there a chance to get some help?

Thanks a lot
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Making Outlook Appointments

Post by Alexander Riedel »

Aside from your code being a bit sparse, you also do not provide any error information.
I also notice that you have omitted the PowerShell version as well. Given that there is Windows PowerShell, PowerShell 7.0, 7.1, 7.2 and 7.3 all using different .NET versions, this is an important tidbit.
If you have isolated the code causing the problem, run it in a console. Do not use try and catch but let it show the actual error message.
Most likely your system log will also hold additional details.
Outlook is a Microsoft product. They are ultimately much better equipped to tell you what is happening, provided you supply the actual error message.
PowerShell Studio does nothing to prevent or enable Outlook and has no influence on that.
Last but not least, you stipulate that whatever code you have works on another machine. So start looking at what is different.
Runtime versions, Outlook versions. OS. Patch levels.
If you want help you need to provide more information.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 1 year and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked