View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joeeng joeeng is offline
external usenet poster
 
Posts: 54
Default vba compiler operation

I would like to have the Acrobat Distiller reference selected as default, but
not get compiler errors on computers that do not have it installed.

If I understand your answer, you suggest having Acrobat Distiller reference
not selected as default and force the user to make the selection in order to
get it to work. Am I understanding correctly? I really would like to go the
opposite way though. Another alternative, can I programmatically check to
see if the Distiller is present on the computer and then programmatically
select/unselect the reference accordingly?

"Jim Thomlinson" wrote:

I have seen issues with code that does not compile doing odd things. Why not
make the code work on all systems whether they have the distiller or not. I
assume the issue is with missing references. If that is the case then use
late binding instead of early binding and check to see if all is well...

dim Distiller as object

on error resume next
set distiller = CreateObject("MyDistiller")
on error goto 0

if distiller is nothing then
msgbox "No PDF..."
else
msgbox "PDF to your hearts content..."
end if
--
HTH...

Jim Thomlinson


"joeeng" wrote:

Can anyone tell me if the vba compiler compiles all the code in every module
at once for a workbook, or does it compile the code in the modules as they
are called?

Can I place code that will not work on all computers in a module by itself,
and have Excel still operate without compiler errors if the module containing
the offending code is not called?

I have code for creating pdf files that works on computers with PDF
Distiller. I want to have the code available to those computers, but still
run without compiler errors on computers without PDF Distiller.