Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel VBA error

Posted on 2014-04-26
6
Medium Priority
?
323 Views
Last Modified: 2014-04-26
Sub TestPdf()
    ActiveWorkbook.Sheets("Scorecard").Activate
   
   
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:="\\pmcfs\groups\Accounting\Physician Stats\PhysRpts\Testsc"
       
       
       
End Sub

the above sub routine is giving me the error in Excel 2007:

Invalid Procedure Call or Argument

How can I fix this?

Thanks

Glen
0
Comment
Question by:GPSPOW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 36

Expert Comment

by:Kimputer
ID: 40025058
Export to PDF was introduced in Office 2010. I'm afraid you're using VBA code you picked up meant for Office 2010+.
0
 

Author Comment

by:GPSPOW
ID: 40025062
With all the different version out there now.  Is there a backwards compatability fix to save an Excel sheet as a PDF if the user is using Excel 2003 or 2007?
0
 
LVL 36

Expert Comment

by:Kimputer
ID: 40025067
No, a function will not magically appear in older programs. If this magic happened, no person would ever buy new programs either.

Now you're backup solution might be to check if the version is 2007 or older, then check if PDF creator is installed, then use alternate code to generate it.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:GPSPOW
ID: 40025114
I've requested that this question be deleted for the following reason:

Since there is not backwards compatibility between Excel 2010 and v. 2003 & 2007 to create a PDF without external programming, I am dropping the question and will try to figure out another way to do what I need.

Thanks

Glen
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 2000 total points
ID: 40025115
You can use the code you posted in 2007 after you install the SaveAsPDF addin from Microsoft.
0
 

Author Closing Comment

by:GPSPOW
ID: 40025194
Ill try it.

Thanks

Glen
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question