PC Review


Reply
Thread Tools Rate Thread

command not found when using excel VBA function format

 
 
OHCQ_DB
Guest
Posts: n/a
 
      7th Dec 2009
I have an extensive piece of VBA code that use the format function. The
macros run on my development machine and on one other in building. I tried
to use the code on an additional computer and got a command not found error.
I am assuming that means that there is some file missing on that computer.
Can anyone suggest what the specific fiel might be?

Thank you
 
Reply With Quote
 
 
 
 
RadarEye
Guest
Posts: n/a
 
      7th Dec 2009
On 7 dec, 19:40, OHCQ_DB <OHCQ...@discussions.microsoft.com> wrote:
> I have an extensive piece of VBA code that use the format function. *The
> macros run on my development machine and on one other in building. *I tried
> to use the code on an additional computer and got a command not found error. *
> I am assuming that means that there is some file missing on that computer.. *
> Can anyone suggest what the specific fiel might be?
>
> Thank you


Hi OHCQ_DB

On one of the machines the project does work:
Load de file
Open the VBE ([Alt]+[F11])
Click Tools --> References.
All needed / used extra files are listed here.
Copy the filenames

On one of the machines the project is not working:
do the same and check if one is missing
There should be a marking with "MISSIING" in the list.

Hoop This Help,

Radareye
 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      7th Dec 2009
Every VBA project requires references to external libraries. At a
minimum, you need references to VBA, OLE, Office, and Excel. You can
safely assume these will be in place on any machine running a
compatible version of Excel. However, if your project requires other
libraries, it is not safe to assume that these will exist on another
machine. If a required library cannot be found on the machine on which
the code is to be run, you can get odd errors, such as the compiler
complaining that some fundamental VBA function (e.g. Left) cannot be
found. This can be confusing because the library that contains the
bitched at command (eg., Left, defined in the VBA typelib) is clearly
in place. The absence of one library can cause the compiler to
complain about functions defined in other libraries.

On the machine that is exhibiting the problems, open the workbook and
then open the VBA editor. There, go to the Tools menu, choose
References, and look for any reference(s) marked as "MISSING". If a
library is missing, you can do one of two things. If you don't really
need the library, you can uncheck it and forget about it. If you do in
fact need the library, you'll need to copy the library file from a
well working machine (assuming you have the legal right to copy and
distribute the file) to the machine that has the problems. Once
copied, you'll likely need to register the library with Windows. Close
out Excel, go to the Windows Start menu, choose Run, and enter the
following, including the quotes as shown. Of course, use the
appropriate file path to the file name.

RegSvr32 "C:\Path\To\File\Filename.dll" /u

Then, do the same thing but without the /u switch:

RegSvr32 "C:\Path\To\File\Filename.dll"

Now, restart Excel and open the workbook.

If you are not able to copy the requisite library to the problematic
machine, then your workbook, as is, cannot be used on that machine.

If you have access to a real installation file builder, such as
InstallShield, Setup Factory, or Advanced Installer, you can create a
setup and deployment project that will automatically copy the required
libraries to the the user's machine and register those libraries with
Windows.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Mon, 7 Dec 2009 10:40:02 -0800, OHCQ_DB
<(E-Mail Removed)> wrote:

>I have an extensive piece of VBA code that use the format function. The
>macros run on my development machine and on one other in building. I tried
>to use the code on an additional computer and got a command not found error.
>I am assuming that means that there is some file missing on that computer.
>Can anyone suggest what the specific fiel might be?
>
>Thank you

 
Reply With Quote
 
Sam Wilson
Guest
Posts: n/a
 
      8th Dec 2009
Can you tell us the line that the error occurs on?


"OHCQ_DB" wrote:

> I have an extensive piece of VBA code that use the format function. The
> macros run on my development machine and on one other in building. I tried
> to use the code on an additional computer and got a command not found error.
> I am assuming that means that there is some file missing on that computer.
> Can anyone suggest what the specific fiel might be?
>
> Thank you

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to highlight a found excel cell when doing the find command? dc Microsoft Excel Misc 0 4th Dec 2008 09:43 PM
Format Cell command will not function Phil Microsoft Excel Misc 1 24th Jan 2008 03:47 PM
Fibonacci function/command in excel?...tia sal Microsoft Excel Worksheet Functions 4 7th Jun 2005 06:27 PM
Fibonacci function/command in excel?...tia sal Microsoft Excel Misc 1 7th Jun 2005 06:08 PM
Fibonacci function/command in excel?...tia sal Microsoft Excel Worksheet Functions 1 7th Jun 2005 06:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 PM.