+ Reply to Thread
Results 1 to 12 of 12

missing syntax when saving as pdf

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    missing syntax when saving as pdf

    hi, I have a macro that is missing a sysntax IF, then statement or an error
    Please Login or Register  to view this content.
    I get compile error, please help.
    Last edited by chubbychub; 10-08-2016 at 02:15 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: missing syntax when saving as pdf

    Maybe try:
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: missing syntax when saving as pdf

    I get compile error, not optional format message.
    Last edited by chubbychub; 10-08-2016 at 03:45 PM.

  4. #4
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: missing syntax when saving as pdf

    Can any VBA master help me please?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: missing syntax when saving as pdf

    The dot at the beginning of the statement says to use a reference established by a prior With statement, which your code doesn't contain. That's why TMS suggested ThisWorkbook.Export -- but only you know what the code is supposed to do, and you haven't shared that.

    Did you write this code, and if not, where did it come from?
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: missing syntax when saving as pdf

    I just copied the code from a tutorial and add it in

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: missing syntax when saving as pdf

    The code was missing the statement?

    Again, what are you trying to do?

  8. #8
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: missing syntax when saving as pdf

    just save the file into pdf format, I read tutorials and change the 2 lines in red and it works, but not sure if its right, I just saw all the tutorials having it so I change it and it works, please tell me if its right.

    Please Login or Register  to view this content.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: missing syntax when saving as pdf

    If it works, and it does what you want, it's probably right. The issue is that you have code that you do not understand.

    You would be better off recording a macro while you save your fie as a .pdf and see what you get.

  10. #10
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: missing syntax when saving as pdf

    what does this 2 lines means :
    Dim strFilename As String <----------------------THIS LINE WAS ADDED
    Dim rngRange As Range <---------------------- THIS LINE WAS ADDED

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: missing syntax when saving as pdf

    Thanks for the rep.

+ 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. [SOLVED] Syntax error (missing operator) when UPDATE in ODBC SQL
    By mc84excel in forum Access Tables & Databases
    Replies: 8
    Last Post: 07-05-2015, 07:40 PM
  2. [SOLVED] Syntax error (Missing operator) in query expression
    By lengwer in forum Access Tables & Databases
    Replies: 2
    Last Post: 08-22-2013, 04:00 PM
  3. OFFSET FUNCTION: Syntax or a missing Formula:
    By niceguy21 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-05-2012, 03:30 PM
  4. Syntax Error (missing Operator) in query expression
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2011, 11:59 AM
  5. Saving a file - syntax error
    By Foxcan in forum Excel General
    Replies: 0
    Last Post: 07-20-2009, 06:35 PM
  6. Format for Saving a Workbook [maybe Syntax issue]
    By AdamParker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2008, 07:59 PM
  7. [SOLVED] Syntax error (missing operator) in query expression '6 Wescott Rd#
    By shealy in forum Excel General
    Replies: 0
    Last Post: 06-09-2005, 05:05 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