If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Macro in Excel 2002 Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-21-04, 23:16
davidkoh79 davidkoh79 is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Macro in Excel 2002 Problem

Hi there

I have been using Microsoft Excel 2002 to write my Macro. I use this macro to process my data. However, when I export this macro to a computer with Microsoft Excel 2000,the code is the same but when I run the macro in Microsoft Excel 2000, the macro does not run correctly and there are errors. Can somebody tell me why and how to go about solving this.
Thank you.
Reply With Quote
  #2 (permalink)  
Old 06-22-04, 07:57
robojam robojam is offline
Registered User
 
Join Date: Feb 2004
Location: Charlotte, NC
Posts: 79
I think you would have to give more details of the macro and any errors.
__________________
Make something idiot proof and someone will make a better idiot...
Reply With Quote
  #3 (permalink)  
Old 06-22-04, 11:38
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
As for why - the object model changed slightly from 2000 to 2002. As robojam indicated, more details about the macro will help resolve the difficulty.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #4 (permalink)  
Old 06-23-04, 01:19
davidkoh79 davidkoh79 is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Details

Hi

I use the macro(which was written in Excel 2002) and ran this macro in Excel 2000.My macro is about searching some values and replacing these values using the replace command. When I run the macro, an error msg appear saying Compile Error Named argument not found and the Search Format is highlighted. Is it the Excel 2000 has a different library to that of Excel 2002?
Thanks
Reply With Quote
  #5 (permalink)  
Old 06-23-04, 06:46
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Im Not entirely sure what you mean.
If you are needing to replace text with a specific format in Excel 2000 then you can so it this way.

in my example i used numberformat but adjust to your needs

Code:
If Application.Version = "9*" Then
    For Each Cell In Range("A1:D10")
        If Cell.NumberFormat = "0" Then
            Cell.Replace "*", "This Text"
        End If
    Next Cell
End If
To explain what's going on the application.version = "9*" looks for Excel 2000
i then search each cell in a specific range and if the Number format is "0" then it will replace any text with "This Text"
I had to do this with creating Charts from a pivot table in 97 to 2000 as the pivotchart was introduced, I don't Know anything of the new features of 2002 so im just guessing at a soloution

Hope this helps in any way
David
Reply With Quote
  #6 (permalink)  
Old 06-23-04, 07:36
robojam robojam is offline
Registered User
 
Join Date: Feb 2004
Location: Charlotte, NC
Posts: 79
Post the offending piece of VBA, as I have Excel 2000 here at work and I will see if I can find out where the problem lies. Try to give an example of the type of data in cells too.
__________________
Make something idiot proof and someone will make a better idiot...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On