Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default vba compiler operation

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default vba compiler operation

If don't force a compile by doing it manually, then this should work.

--
Regards,
Tom Ogilvy


"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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default vba compiler operation

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default vba compiler operation



http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/?id=160647
XL97: How to Programmatically Create a Reference

--
Regards,
Tom Ogilvy


"joeeng" wrote:

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.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default vba compiler operation

How do I determine what to substitute for "MyDistiller" in the CreateObject
statement below?

"Tom Ogilvy" wrote:



http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/?id=160647
XL97: How to Programmatically Create a Reference

--
Regards,
Tom Ogilvy


"joeeng" wrote:

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.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vba compiler operation

Perhaps:

Dim MyDistiller As Object
Set MyDistiller = CreateObject("PdfDistiller.PdfDistiller.1")
MyDistiller.FileToPdf "f:\my.ps", "", ""



--
Regards,
Tom Ogilvy



"joeeng" wrote in message
...
How do I determine what to substitute for "MyDistiller" in the
CreateObject
statement below?

"Tom Ogilvy" wrote:



http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/?id=160647
XL97: How to Programmatically Create a Reference

--
Regards,
Tom Ogilvy


"joeeng" wrote:

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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler Error - Not an Appropriate Name pallaver Excel Discussion (Misc queries) 1 July 16th 08 02:20 AM
Excel Compiler Steve-in-austin Excel Discussion (Misc queries) 2 June 8th 06 06:44 PM
Help with compiler error Pank Mehta Excel Programming 1 March 11th 05 12:03 PM
Compiler Error Chris Excel Programming 2 December 9th 04 05:02 PM
Excel Compiler - is one available? John Baker Excel Programming 11 October 25th 03 01:33 PM


All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"