VBA - Function library back references problem

  • Thread starter Thread starter Kevin Dufendach
  • Start date Start date
K

Kevin Dufendach

I recently received report from a user that my PowerPoint with macros
written in PowerPoint 2010 does not work in PowerPoint 2007.
Unfortunately, I don't have a version of 2007 to be able to test it
myself, but I did try the files in ppt 2003. When I do, I get the
Compile error: "Can't find project or library," and the function
"Str(number)" is highlighted. I was able to work around it by using
"VBA.Str(number)," but I'd rather not go through and do this for every
standard function in my module. Is there a way to define this
globally?

Thanks,
Kevin
 
Kevin Dufendach said:
I recently received report from a user that my PowerPoint with macros
written in PowerPoint 2010 does not work in PowerPoint 2007.
Unfortunately, I don't have a version of 2007 to be able to test it
myself, but I did try the files in ppt 2003. When I do, I get the
Compile error: "Can't find project or library," and the function
"Str(number)" is highlighted. I was able to work around it by using
"VBA.Str(number)," but I'd rather not go through and do this for every
standard function in my module. Is there a way to define this
globally?

VBA should look for functions in the current project first, so you should
be able to define your own function of the same name, which does the
redefining in your file:

Public Function Str(Number)
Str = VBA.Str(Number)
End Function
 
True, that would work, but then I'd still have to define a new
function for every standard method I use, so I'd have Str, Trim, Num,
InStr, etc. I feel like there should be a more elegant and thorough
way to do this.

Thanks,
Kevin
 
Thanks for the tip. Checked my references library, and the reference
library missing is "Microsoft Excel 14.0 Object Library." In one of my
macros, I import data from an Excel file, so I'm assuming that's where
the reference is coming from. I originally wrote all the Excel
importating code in PPT/Office 2003, and it worked fine. It's obvously
a reference thing that I'm assuming is getting altered when I save it
as a PPT 2010 file.

Could I get around this error by compiling the project or storing it
as a library file or another reference file? If you're curious about
my application, it's my Jeopardy template available here. Code is not
locked or hidden at all:
https://sites.google.com/site/dufmedical/jeopardy

Thanks,
Kevin
 
Back
Top