ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compile Error: with VBA call to "Format" (https://www.excelbanter.com/excel-programming/433408-compile-error-vba-call-format.html)

jc

Compile Error: with VBA call to "Format"
 
In trying to run a VBA macro on a EXCEL 2002 machine that has work on other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC

Bob Phillips[_3_]

Compile Error: with VBA call to "Format"
 
In the VBIDE, goto ToolReferences. There you will see an item with MISSING
in its text. Uncheck it.

--
__________________________________
HTH

Bob

"jc" wrote in message
...
In trying to run a VBA macro on a EXCEL 2002 machine that has work on
other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC




Barb Reinhardt

Compile Error: with VBA call to "Format"
 
I've never done any VBA with 2002, but I wonder of Format is supported. You
could try to use WorksheetFunction.Text to see if that works.

HTH,
Barb Reinhardt

"jc" wrote:

In trying to run a VBA macro on a EXCEL 2002 machine that has work on other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC


Bob Phillips[_3_]

Compile Error: with VBA call to "Format"
 
I don't have XP on this machine Barb, but I do have 2000, and format works
there, so it is bound to work in XP.

--
__________________________________
HTH

Bob

"Barb Reinhardt" wrote in message
...
I've never done any VBA with 2002, but I wonder of Format is supported.
You
could try to use WorksheetFunction.Text to see if that works.

HTH,
Barb Reinhardt

"jc" wrote:

In trying to run a VBA macro on a EXCEL 2002 machine that has work on
other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC




EricG

Compile Error: with VBA call to "Format"
 
Check under "Tools/References" in the Visual Basic Editor to see if you have
any bad references. This could have happened if the VBA was written on a
machine with 2003, and then moved to a machine with 2002.

HTH,

Eric


"jc" wrote:

In trying to run a VBA macro on a EXCEL 2002 machine that has work on other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC


jc

Compile Error: with VBA call to "Format"
 
does any one know specifically which reference is need to run the format
function in VBA.
--
CroceJC


"EricG" wrote:

Check under "Tools/References" in the Visual Basic Editor to see if you have
any bad references. This could have happened if the VBA was written on a
machine with 2003, and then moved to a machine with 2002.

HTH,

Eric


"jc" wrote:

In trying to run a VBA macro on a EXCEL 2002 machine that has work on other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC


Bob Phillips[_3_]

Compile Error: with VBA call to "Format"
 
That is not the problem, it is a detached reference having a knock-on
problem. Just uncheck the MISSINGs as I said.

--
__________________________________
HTH

Bob

"jc" wrote in message
...
does any one know specifically which reference is need to run the format
function in VBA.
--
CroceJC


"EricG" wrote:

Check under "Tools/References" in the Visual Basic Editor to see if you
have
any bad references. This could have happened if the VBA was written on a
machine with 2003, and then moved to a machine with 2002.

HTH,

Eric


"jc" wrote:

In trying to run a VBA macro on a EXCEL 2002 machine that has work on
other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC




Jim Thomlinson

Compile Error: with VBA call to "Format"
 
There is no specific library for Format. If you have a missing reference then
it will highlight a function at random and throw the error. When you open
your file on a 2002 machine under references in VBA - Tools - References
one of the references will be tagged as "Missing:". Any reference to one of
the other MS Office programs such as Word or Access is a likely candidate.
--
HTH...

Jim Thomlinson


"jc" wrote:

does any one know specifically which reference is need to run the format
function in VBA.
--
CroceJC


"EricG" wrote:

Check under "Tools/References" in the Visual Basic Editor to see if you have
any bad references. This could have happened if the VBA was written on a
machine with 2003, and then moved to a machine with 2002.

HTH,

Eric


"jc" wrote:

In trying to run a VBA macro on a EXCEL 2002 machine that has work on other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC


Dave Peterson

Compile Error: with VBA call to "Format"
 
And the missing reference may not have anything to do with the line that's
causing the error.



jc wrote:

does any one know specifically which reference is need to run the format
function in VBA.
--
CroceJC

"EricG" wrote:

Check under "Tools/References" in the Visual Basic Editor to see if you have
any bad references. This could have happened if the VBA was written on a
machine with 2003, and then moved to a machine with 2002.

HTH,

Eric


"jc" wrote:

In trying to run a VBA macro on a EXCEL 2002 machine that has work on other
EXCEL 2003 machines.

The code interupts with:

"Compile error: Can't find project or library"

on hitting OK it goes into the VBA editor.

The word "Format" is highlited

What do I need to get format to work?
--
CroceJC


--

Dave Peterson

Chip Pearson

Compile Error: with VBA call to "Format"
 
There is no specific library for Format.

Actually, there is. It is the VBA library and the Format function,
like any function, can be overridden by a function in a library with
higher precedence.

Function Format(X As Double) As Double
Format = X * 2
End Function

Sub AAA()
' two very different Format functions
Debug.Print Format(10)
Debug.Print VBA.Strings.Format(10)
End Sub





Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 10 Sep 2009 12:07:09 -0700, Jim Thomlinson
wrote:

There is no specific library for Format. If you have a missing reference then
it will highlight a function at random and throw the error. When you open
your file on a 2002 machine under references in VBA - Tools - References
one of the references will be tagged as "Missing:". Any reference to one of
the other MS Office programs such as Word or Access is a likely candidate.



All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com