+ Reply to Thread
Results 1 to 3 of 3

cant export to PDF - file name too big

  1. #1
    Registered User
    Join Date
    11-18-2013
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    4

    cant export to PDF - file name too big

    Hi,

    I'm trying to use vba to export a file to pdf. I've been successful, until i ran into this problem. See, I use this macro to create a .xlsx file, it gathers copies of tabs from many different files and select them and save it as .pdf . The saving part is like

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="\\serv-arq\Previdencia_2012\publico_leitura\...\filename.pdf", _
    Quality:=xlQualityStandard, IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, OpenAfterPublish:=True

    the folder in file name just the folder of the excel file which contains the macro. my problem is that this filename is too big (over 218 characters), because the path is too big, and i cant fix that !

    if, instead, i use just "filename.pdf" it saves in some default folder, like My Documents. So i decided to change default folder, using the macro, to the current path, but that didnt help either. The funny thing is that if i create a macro directly in the generated .xlsx file in order to generate the pdf it works.

    Any thoughts ?

    Thanks in advance,

    Rafael
    Last edited by rjeronimo; 11-18-2013 at 08:27 AM.

  2. #2
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: cant export to PDF - file name too big

    You can save network path as a drive letter. ie. Q:\ = "\\fileserver\department\user\savedfiles\", then use "Q:\filename.pdf"

  3. #3
    Registered User
    Join Date
    11-18-2013
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: cant export to PDF - file name too big

    hi slx, thanks for the response.

    sorry for my ignorance, but how is that done ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Export To Inf file & Zip the Files from the given file paths picking every 10 rows
    By vivekhalder in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2012, 03:59 AM
  2. Export Excel records to seperate text file & compress it to protecte ZIP file
    By firedragon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2012, 10:47 AM
  3. Export excel file to semicolon delimited text file
    By capitan in forum Excel General
    Replies: 5
    Last Post: 04-06-2005, 11:07 PM
  4. Export excel file to semicolon delimited text file
    By capitan in forum Excel General
    Replies: 5
    Last Post: 04-06-2005, 11:07 PM
  5. How do I import text file, analyze data, export results, open next file
    By Geoffro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2005, 04:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1