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.

Problema con macro en excel 2002

publicado

Hola, quisiera saber si me podéis ayudar con un problema que tengo con una macro para enviar una hoja en formato pdf, el código es el que adjunto en la parte inferior y mi problema es que con office 2010 lo envió sin problemas, pero en la empresa tengo el 2002 y al enviarlo me sale un error de que no encuentra la ruta del archivo y no sé cómo solucionarlo, espero vuestra ayuda, por cierto, en la empresa uso Windows xp, muchas gracias.

 

Sub SendMailbyOutlookCSheetPdf()
On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim OA, OM As Object
Dim NA As Variant
Dim Path, TD, fn, mydoc As String
TD = Format(Date, "ddmmyyyy")
Path = ThisWorkbook.Path & "\"
fn = ActiveSheet.Name
mydoc = Path & fn & ".pdf"
Dest = Cells(3, "E")
Sheets(fn).Copy
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
mydoc, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
ActiveWorkbook.Close False

Set OA = CreateObject("Outlook.Application")
Set OM = OA.CREATEITEM(0)
With OM
.To = "xxxxxxxx@gmail.com"
.CC = ""
.BCC = ""
.Subject = "Material"
.Body = "Buenos días, un saludo"
.attachments.Add mydoc
.Send
End With
If Err.Number = 0 Then
SendMail_Gmail = True
MsgBox "El correo fue enviado con éxito", vbInformation, "Aviso"
Else
MsgBox "Se produjo el siguiente error: " & Err.Description, vbCritical, "Error nro " & Err.Number
End If
Kill mydoc
Set OM = Nothing
Set OA = Nothing
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub

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.