Unrecognized term "Format"
Solved
Magali
-
Magali -
Magali -
Hello,
Here is a problem I can't find the cause of:
I have a program that allows me to populate a combo box with the 12 months of the year:
On my PC it works very well. But on my colleague's PC, the program bugs and does not recognize the term "Format".
Where could this come from?
Thank you in advance for your help
Magali
Here is a problem I can't find the cause of:
I have a program that allows me to populate a combo box with the 12 months of the year:
Dim mois(1 To 12) As String
Dim l As Integer
With Sheets("Calendrier 2 ans")
For l = 1 To 12
mois(l) = Format(DateSerial(1, l, 1), "mmmm")
Me.ComboBox3.AddItem mois(l)
Next l
End With
On my PC it works very well. But on my colleague's PC, the program bugs and does not recognize the term "Format".
Where could this come from?
Thank you in advance for your help
Magali
4 answers
-
Here is the error message:
Compile error in hidden module: Sheet4.
This error commonly occurs when code is incompatible with the version, platform, or architecture of this application. Click "Help" for information on how to correct this error.
So how can we modify this line:month(l) = Format(DateSerial(1, l, 1), "mmmm")
to have the months in full letters in the combobox?
Magali -
Hello,
in French and in-line English comment: change the name of the combobox
Mois_txt = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
'Mois_txt = Array("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre")
Cmb_Mois.Clear
Cmb_Mois.List = Mois_txt
If the Format instruction is not recognized, there will be others. Check in the VBA references of your PC and in the one that's causing issues. -
Hello,
sometimes you have this if a reference is missing.
In VBA, check in 'tools / references...' if you have one marked [Missing]. Uncheck it (note it down before).
eric
--
By continuously trying, we eventually succeed.
So the more it fails, the more chances we have that it will work. (the Shadoks)
In addition to the thank you (yes, it’s done!!!), remember to mark it as resolved. Thank you -
Indeed, Eric, I have the reference "Microsoft Office XP Web Components" checked on my PC, and on my colleague's it is noted as MISSING.
So he unchecked it, but could this cause problems later on? Because I don't know what this reference is for...-
Hello,
It all depends if you are actually using it in your file; that's something only you know what you've done.
If yes, there will be a part that won't work. You will either have to change your program not to exploit it, or install this library on all the machines that don't have it (which can sometimes be a hassle).
eric -
-