ActiveWorkbook_Zip_Mail() en las ultimas lineas marco un error...

14/02/2004 - 05:01 por Javier | Informe spam
Sub ActiveWorkbook_Zip_Mail()

Dim PathWinZip As String, FileNameZip As String,
FileNameXls As String
Dim ShellStr As String, strdate As String
Dim Runwzzip As Long
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
strdate = Format(Now, "dd-mm-yy h-mm-ss")
PathWinZip = "C:\program files\winzip\" ' Be sure
that this is the path where WinZip is installed.
FileNameZip = "C:\" & Left(ActiveWorkbook.Name, Len
(ActiveWorkbook.Name) - 4) & " " & strdate & ".zip "
FileNameXls = "C:\" & Left(ActiveWorkbook.Name, Len
(ActiveWorkbook.Name) - 4) & " " & strdate & ".xls"
ActiveWorkbook.SaveCopyAs Filename:=FileNameXls

ShellStr = PathWinZip & "Winzip32 -min -a " _
& " " & Chr(34) & FileNameZip & Chr(34) _
& " " & Chr(34) & FileNameXls & Chr(34)
Runwzzip = Shell(ShellStr, vbHide)

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "jrodrigu@grupolala.com"
.CC = ""
.BCC = ""
.Subject = "ZipMailTest"
.Body = "Here is the File"
.Attachments.Add FileNameZipexactamente aqui me
envia un error.
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
Kill FileNameZip
Kill FileNameXls
End Sub

Preguntas similare

Leer las respuestas

#1 Héctor Miguel
14/02/2004 - 05:12 | Informe spam
hola, Javier !

.Attachments.Add FileNameZipexactamente aqui me envia un error.



como dice la macro del 'ejemplo'...
PathWinZip = "C:\program files\winzip\" ' Be sure that this is the path where WinZip is installed.


==> ESTA SEGURO de que 'esta ruta' ES DONDE esta instalada la utileria 'WinZip' <=
la razon... la variable 'PathWinZip' [de tipo 'string'] esta siendo 'dirigida' a ESE directorio :((
y [casi con seguridad] EN TU PC el directorio sea: =>C:\Archivos de programa\WinZip\<[por lo tanto]... al NO haberse 'encontrado' el ejecutable para compactar [por 'ruta equivocada']
=> el archivo 'resultante' NO se pudo 'hacer' :((
[por lo tanto]... NO 'existe' para que se pueda 'agregar' al correo ;)

saludos,
hector.
Respuesta Responder a este mensaje
#2 JAvier
14/02/2004 - 17:32 | Informe spam
que otra cosa puede ser????

saludos

hola, Javier !

.Attachments.Add FileNameZipexactamente aqui




me envia un error.

como dice la macro del 'ejemplo'...
PathWinZip = "C:\program files\winzip\" ' Be




sure that this is the path where WinZip is installed.
==> ESTA SEGURO de que 'esta ruta' ES DONDE esta


instalada la utileria 'WinZip' <=>
la razon... la variable 'PathWinZip' [de tipo 'string']


esta siendo 'dirigida' a ESE directorio :((
y [casi con seguridad] EN TU PC el directorio sea:


=>C:\Archivos de programa\WinZip\<>[por lo tanto]... al NO haberse 'encontrado' el
ejecutable para compactar [por 'ruta equivocada']
=> el archivo 'resultante' NO se pudo 'hacer' :((
[por lo tanto]... NO 'existe' para que se pueda 'agregar'


al correo ;)

saludos,
hector.


.

Respuesta Responder a este mensaje
#3 osalazarg
16/02/2004 - 16:54 | Informe spam
¿Cual es el nombre de tu archivo que deseas enviar?
ya que tu macro dice
C:\" & Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & " " &
strdate & ".zip "
yo creo que el nombre del archivo es el culpable de que te envie error.

Saludos.

JAvier wrote:

que otra cosa puede ser????

saludos

>hola, Javier !
>
>> .Attachments.Add FileNameZipexactamente aqui
me envia un error.
>
>como dice la macro del 'ejemplo'...
>> PathWinZip = "C:program fileswinzip" ' Be
sure that this is the path where WinZip is installed.
>==> ESTA SEGURO de que 'esta ruta' ES DONDE esta
instalada la utileria 'WinZip' <=> >
>la razon... la variable 'PathWinZip' [de tipo 'string']
esta siendo 'dirigida' a ESE directorio :((
>y [casi con seguridad] EN TU PC el directorio sea:
=>C:Archivos de programaWinZip<> >[por lo tanto]... al NO haberse 'encontrado' el
ejecutable para compactar [por 'ruta equivocada']
>=> el archivo 'resultante' NO se pudo 'hacer' :((
>[por lo tanto]... NO 'existe' para que se pueda 'agregar'
al correo ;)
>
>saludos,
>hector.
>
>
>.
>








Mensaje enviado desde http://grupos.buscadoc.org

email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida