Problem VBA REPLACE FUNCTION

IGORR

New Member
Joined
Apr 24, 2015
Messages
6
Good morning;

I need the help o somebody with the following code.

The error is "Argument not valid".

Sub PrintPDFServ() '*****Imprimir sin visualizacion*****
Application.ScreenUpdating = False
'Para Crear archivos PDF Desde Excel nada mas tienes que instalar el complemeto para guardar archivos pdf de Oficce
Dim sDate
sName = Replace(Sheets("Ficha Tecnica Serv").Range("E6"), ".", "_")
sDescrip = Replace(Sheets("Ficha Tecnica Serv").Range("E8"), ".", "_")
Set sDate = Sheets("Ficha Tecnica Serv").Range("I6")
XName = sName & "-" & sDescrip & " (" & Format(sDate, "ddmmyyyy") & ")"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\SERVIDORVELL\docs\Ejea\Calidad\Especificaciones\Especificaciones Tecnicas Materiales\Papel\Fichas Tecnicas de Papel\Definitivo\" & XName & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
Application.ScreenUpdating = True
End Sub

Thanks in advance.
 
Th problem is other.

Excell has a limit of characterest with the path and the name included of 216 characteres.

In the example the path is so long.

Anyway the changes you have proposed works.

Many thanks
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top