Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FORMAT Compile error - can't find project or library

Status
Not open for further replies.

Welshbird

IS-IT--Management
Jul 14, 2000
7,378
DE
I have a VBA project I wrote (on a machine running 2010) whcih I'm now trying to test on a machine running 2007.

The code doesn't appear to be complicated:
Code:
Private Sub userform_activate()
    cmbRAD.RowSource = ""
    cmbRAD.Clear
    cmbPCO.RowSource = ""
    cmbPCO.Clear
    cmbRAD.Value = Worksheets("Calculations").Range("B1")
    cmbPCO.Value = Worksheets("Calculations").Range("B2")
    txtDiscount.Value = Format(Worksheets("Calculations").Range("H10"), "Percent")
    txtSwitch.Value = Format(Worksheets("Calculations").Range("H11"), "Percent")
    cmbRAD.RowSource = "Geography!G2:G31"
    Call populateContact
    Call populatePCO
End Sub

It's highlighting the word FORMAT as a compile error.

What on earth is wrong? And help would be hugely appreciated.

Fee

"The cure for anything is salt water – sweat, tears, or the sea." Isak Dinesen
 
UPDATE:

I had added references for Outlook and Word (as the project is mail-merging into a word document and then emailing a PDF)

But the references are missing on the other laptop.

How do I manage to do this then?

Fee

"The cure for anything is salt water – sweat, tears, or the sea." Isak Dinesen
 
So, I have to add teh references to Office 12 on a 2007 machine and then distribute3 the appropriate version to appropriate machines?

Is this really the right way to go about this?

Ta chaps.

Fee

"The cure for anything is salt water – sweat, tears, or the sea." Isak Dinesen
 
Another way is to use late binding.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

You need to develop at the level of the earliest version - references to Word / Outlook 2007 should automatically convert to 2010, but not vice-versa.


Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Oh OK - So I make a 2007 version, and that will work on 2010, but not vice versa.

Thanks chaps.

Fee

"The cure for anything is salt water – sweat, tears, or the sea." Isak Dinesen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top