Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102
    Quote Originally Posted by davegri View Post
    That is not what is displayed via a Debug.Print.

    If you don't know how to properly use the Immediate Window, change the Debug.Print line before the yellow line to display a message box:

    Msgbox "Dateiname is " & Dateiname

    What does the message box show?
    It shows : "221129 Offerte STRABAG BMTI GmbH .pdf"

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    Quote Originally Posted by Akchayan View Post
    It shows : "221129 Offerte STRABAG BMTI GmbH .pdf"
    And as mentioned, it is likely that Windows does not like the space before ".pdf"?

    Rename a file with that and see if it accepts it, and you can open it from withing Access.

    I have just tried with windows explorer on one of my files and it did not complain, despite it looking odd?

    GCCS Passengers - G. pdf

    Word does not object
    Code:
    With wdApp.ActiveDocument
        .SaveAs Filename:=StrMMPath & strPDFName & " .pdf", FileFormat:=wdFormatPDF, AddToRecentFiles:=False
        '.Close SaveChanges:=False
    End With
    but where is your path?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #18
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102
    Quote Originally Posted by Welshgasman View Post
    And as mentioned, it is likely that Windows does not like the space before ".pdf"?

    Rename a file with that and see if it accepts it, and you can open it from withing Access.

    I have just tried with windows explorer on one of my files and it did not complain, despite it looking odd?

    GCCS Passengers - G. pdf

    Word does not object
    Code:
    With wdApp.ActiveDocument
        .SaveAs Filename:=StrMMPath & strPDFName & " .pdf", FileFormat:=wdFormatPDF, AddToRecentFiles:=False
        '.Close SaveChanges:=False
    End With
    but where is your path?
    TY Very much Welshgasman it worked!!! It was the space before ".pdf"

  4. #19
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    It was the space before ".pdf"

    as prompted to you 9 posts ago. Recommend you read all the posts and respond

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. 2501 error
    By Roncc in forum Access
    Replies: 37
    Last Post: 01-18-2018, 06:33 PM
  2. Replies: 7
    Last Post: 10-20-2016, 03:58 AM
  3. Runtime Error 2501 on docmd.runSQL
    By schwachmama in forum Access
    Replies: 5
    Last Post: 04-17-2015, 11:28 AM
  4. Replies: 2
    Last Post: 08-05-2013, 01:56 PM
  5. runtime error 2501 openform action was canceled
    By rumenrs in forum Programming
    Replies: 2
    Last Post: 04-11-2013, 04:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums