9,712 questions
How to get Microsoft Teams meeting URL by using VBA
PEI Simon (CI/PIO4)
0
Reputation points
I want to use excel VBA code to create a TEAMS meeting and get the URL of the meeting to the excel worksheet. My code as below.
Sub GetTeamsMeetingLink()
Dim oApp As Object
Dim oMeeting As Object
Dim strMeetingLink As String
Set oApp = CreateObject("Outlook.Application")
Set oMeeting = oApp.CreateItem(olAppointmentItem)
'set meeting info
With oMeeting
.Subject = "TEST"
.RequiredAttendees = "******@TEST.COM"
.Start = (Now)
.Duration = 60
.Body = "TEST"
.Location = "Microsoft Teams"
'add teams meeting info
.NetMeetingType = olMeeting
End With
'showup meeting
oMeeting.Display
SendKeys "%h", True
SendKeys "TM", True
'get URL in the meeting
strMeetingLink = oMeeting.GetAssociatedAppointment(False).NetMeetingUrl
Debug.Print strMeetingLink
Set oMeeting = Nothing
Set oApp = Nothing
End Sub
but there was showing up an error at
oMeeting.GetAssociatedAppointment(False).NetMeetingUrl
Hope to get help here!
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft 365 and Office | Excel | For business | Windows

3,917 questions
Microsoft Teams | Microsoft Teams for business | Other
10,935 questions
Sign in to answer