+ Reply to Thread
Results 1 to 4 of 4

Problem: save as pdf in the same folder

  1. #1
    Registered User
    Join Date
    07-28-2018
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    2

    Problem: save as pdf in the same folder

    Hi all,

    I am trying to save my Sheets PDF in the same folder with my excel file.
    However... i have error 1004

    Dim strName As String
    strName = ActiveWorkbook.Worksheets("input").Cells(3, 2).Value & ".pdf"
    Dim strPath As String
    strPath = ActiveWorkbook.Path & Application.PathSeparator

    MsgBox strPath & strName

    Sheets(Array("T1", "T2", "T3")).Select

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
    filename:=strPath & strName, _
    Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
    :=False, OpenAfterPublish:=True


    I'm not sure why i have the error.

    Please help me

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Problem: save as pdf in the same folder

    Where do you get the error?

    Maybe attach your sample workbook.

    Go Advanced -> Manage Attachments -> Upload

  3. #3
    Registered User
    Join Date
    07-28-2018
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    2

    Re: Problem: save as pdf in the same folder

    Hi,

    I used a window computer...and it worked

    I guess the problem is the MACBOOK... maybe the code for macbook is a bit different

  4. #4
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Problem: save as pdf in the same folder

    Quote Originally Posted by ericnguyen View Post
    I guess the problem is the MACBOOK...
    Unsurprising.

+ 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. Replies: 3
    Last Post: 08-09-2017, 05:09 AM
  2. Replies: 0
    Last Post: 05-19-2017, 05:23 AM
  3. [SOLVED] VBA Code to save to a folder within a folder within a folder all based on cell values.
    By Sintek in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-24-2016, 04:24 PM
  4. [SOLVED] Creating a VBA Script to save in a current month's folder (create folder as needed)
    By spittingfire in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2015, 03:08 PM
  5. [SOLVED] Lookup folder from cell text, then save excel file in this folder
    By dodgybob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2014, 09:00 AM
  6. Problem running "Save macro to all workbook in folder"
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2014, 12:49 AM
  7. Replies: 6
    Last Post: 08-11-2006, 03:41 PM

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