+ Reply to Thread
Results 1 to 8 of 8

Save to PDF VBA error when file is transferred from XP to windows 7

  1. #1
    Registered User
    Join Date
    06-08-2014
    Posts
    4

    Save to PDF VBA error when file is transferred from XP to windows 7

    I am making an exam sheet on excel and got it fully working in XP but when i transferred it to any windows 7 PC a block of code keeps getting "Runtime Error '5' Invalid Procedure, Call or Argument." The highlighted code is as follows:

    ActiveSheet.ExportAsFixedFormat _
    FileFormat:=xlTypePDF, _
    FileName:="C:\Exam.pdf", _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=True

    I have tried using user accounts with full access to the place i am saving. I have also tried recreating the entire thing in windows 7. There is also a timer and several msgbox macros that are working fine, only the print/save to PDF macro is not working.

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    Try replacing...

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.
    Hope this helps!

  3. #3
    Registered User
    Join Date
    06-08-2014
    Posts
    4

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    Sorry i forgot to change the code back when i was fiddling, it was already "Type:=xlTypePDF" in my original so it still doesn't work.

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    It may have something to do with permissions. Try saving the file in another folder, such as your Documents folder...

    Please Login or Register  to view this content.
    Hope this helps!

  5. #5
    Registered User
    Join Date
    06-08-2014
    Posts
    4

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    Sorry but it still doesn't work on any folder or any account i use it won't even save as is in the location where the original excel file is.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    which version of excel? your code works on windows 7 with excel 2010 here with the change to type:=xltypepdf
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  7. #7
    Registered User
    Join Date
    06-08-2014
    Posts
    4

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    It worked on Excel 2007 when i used it on XP and doesn't when i use it on Excel 2007 on Windows 7 Professional. I already changed it to "type:=xltypepdf". I'll try using it on excel 2010 as soon as i can since i don't have a computer here with MS Office 2010

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    Have you installed the additional tools that allow you to export to PDF - I don't think they're included in the standard 2007 install

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Save to PDF VBA error when file is transferred from XP to windows 7

    if service pack 2 or later is present then the functionality is included. if not you do need an add-in

+ 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: 1
    Last Post: 10-29-2013, 08:06 PM
  2. Replies: 4
    Last Post: 06-20-2013, 09:30 AM
  3. Replies: 0
    Last Post: 05-09-2013, 03:48 AM
  4. Replies: 15
    Last Post: 09-25-2012, 10:22 AM
  5. Replies: 4
    Last Post: 03-05-2005, 04:06 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