View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Compile error: Method or data member not found

Hi Oliver,

Your error would suggest that athe ComboBox cmbCompanyCode was not found.

Try checking that the name is correctly spelt - perhaps it should be:

cmbCompanyCodes

(with a final 's') ?


---
Regards,
Norman


"OliverB" wrote in message
...
Hi,

I have developed a spreadsheet for Excel 97/2002. The spreadsheet includes
a
number of controls including a combo box (id cmbCompanyCode). This
spreadsheet has been rolled out to about 2,500 users without many problems
(except 1 user (there is always one!)).

I have recieved the message "Compile error: Method or data member not
found"
when the code "If (Sheet2.cmbCompanyCode.ListIndex 0) Then" is run in
the
following code block...

Private Sub Workbook_Open()

' Get the company codes and hold them in an array...
PopulateCompanyCodes

' Show / Hide the upload button...
Sheet2.btnUploadIntoSAP.Visible =
DefaultProfitCentreFileExists(Range("DefaultProfit CentreIdsPath").Value)

If (Sheet2.cmbCompanyCode.ListIndex 0) Then
' Set the company code from the drop down list selection...
Range("CompanyCode").Value =
arrCompanyCodes(Sheet2.cmbCompanyCode.ListIndex - 1).CompanyCode
Else
Range("CompanyCode").Value = ""
End If

End Sub

When I logged onto this machine and broke into the VBA I tried to use the
immediate window to check whether Sheet2.cmbCompanyCode exists but the
intellisense did not pick up cmbCompanyCode.

My gut feeling is that something relating to COM is screwed up thus the
combo box is not accessible but I have no idea how to fix it.

I have tried the following...
1. Refreshed the copy of the spreadsheet just in case the file is corrupt.
2. Copied the file onto another machine to see if the same problem can be
reproduced - no luck
3. Checked the references inside the vb project - exactly matched to
another
machine that works okay.
4. Crawled the web any only really found a MAC converstion problem with
ActiveX controls.
5. Removed the registry settings from
HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\E xcel and had Excel
rebuild
them (getting desperate!).

Any help is greatly appreciated,

Thanks

Oliver Bullock