Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Crear cita en calendario outlook no default desde excel vba

publicado

Buenas,

Estoy tratando de crear citas en funcion de los datos de una hoja de excel, mi problema no es obtener los datos del excel ni nada por estilo sino utilizar correctamente los objetos para poder acceder a las carpeta no default del Outlook.

Como os digo para crear citas sobre el calendario default no tengo problemas, pero sobre cualquier otro calendario es imposible.

Os adjunto unos códigos...

Sub SetAppt()
Dim olApt As Object ' Outlook.AppointmentItem
Dim olApp As Object ' Outlook.Application
Dim i As Long
Dim apptRange As Variant
Const olAppointmentItem As Long = 1

' create outlook
Set olApp = GetOutlookApp

If olApp Is Nothing Then
MsgBox "Could not start Outlook"
Exit Sub
End If

Set myNameSpace = olApp.GetNamespace("MAPI")
Set myDestFolder = myNameSpace.GetDefaultFolder(olFolderCalendar).Folders("micalendario")
' read appts into array
apptRange = Range(Cells(2, 1), Cells(Rows.Count, 7).End(xlUp)).Value

For i = LBound(apptRange) To UBound(apptRange)
Set olApt = olApp.Add.Item(olAppointmentItem)
With olApt
' Datos de la cita
End With
Next i

End Sub
Function GetOutlookApp() As Object
On Error Resume Next
Set GetOutlookApp = CreateObject("Outlook.Application")[/CODE]

Me da Error 5 en esta linea...

Set myDestFolder = myNameSpace.GetDefaultFolder(olFolderCalendar).Folders("micalendario")

Sin embargo, si esa misma linea la utilizo en las macros de outlook funciona perfectamente...

Como veis ni siquiera intento insertar nada hasta ahora, sólo intento acceder a la carpeta desde Excel...

Featured Replies

No hay posts para mostrar

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.