![]() |
combobox missing between excel 2000 and xp
Hi
I have a spreadsheets that has 2 combobox on it. I have a bit of code to clear both of them when the spreadsheet is first open: Set fSheet = Worksheets("Main") Set fBookCombobox = fSheet.OLEObjects("A") Set fCurrencyCombobox = fSheet.OLEObjects("B") Call fBookCombobox.Object.Clear Call fCurrencyCombobox.Object.Clear and it works fine in excel 2000. When I open the same spreadsheet in excel xp, I am getting "Run-time error '1004' unable to get teh object property of the OLEobject class' at the 'Call fBookCombobox.Object.Clear' line. In the Local window, Combobox named 'A' indeed is not there but 'B' is. If I open the file in XP with macro disabled, save it and reopen in XP again, the code works. But the down side is I gets the same error at the same line when I now open the file in excel 2000. It looks like there are some incompatibility issue ther. Has anyone seen this ? |
combobox missing between excel 2000 and xp
Have you tried it without the "Call" statements?
Jim Cone San Francisco, CA "Dickson Law" wrote in message om... Hi I have a spreadsheets that has 2 combobox on it. I have a bit of code to clear both of them when the spreadsheet is first open: Set fSheet = Worksheets("Main") Set fBookCombobox = fSheet.OLEObjects("A") Set fCurrencyCombobox = fSheet.OLEObjects("B") Call fBookCombobox.Object.Clear Call fCurrencyCombobox.Object.Clear and it works fine in excel 2000. When I open the same spreadsheet in excel xp, I am getting "Run-time error '1004' unable to get teh object property of the OLEobject class' at the 'Call fBookCombobox.Object.Clear' line. In the Local window, Combobox named 'A' indeed is not there but 'B' is. If I open the file in XP with macro disabled, save it and reopen in XP again, the code works. But the down side is I gets the same error at the same line when I now open the file in excel 2000. It looks like there are some incompatibility issue ther. Has anyone seen this ? |
combobox missing between excel 2000 and xp
Hi Jim
Do you mean commenting the two call statement completely? Tried that, but got the same results. The problem seems to be the object has disappeard from the sheet "Main". So whenever I tried to do anything to the object I get the same error. Thanks dickson "Jim Cone" wrote in message ... Have you tried it without the "Call" statements? Jim Cone San Francisco, CA "Dickson Law" wrote in message om... Hi I have a spreadsheets that has 2 combobox on it. I have a bit of code to clear both of them when the spreadsheet is first open: Set fSheet = Worksheets("Main") Set fBookCombobox = fSheet.OLEObjects("A") Set fCurrencyCombobox = fSheet.OLEObjects("B") Call fBookCombobox.Object.Clear Call fCurrencyCombobox.Object.Clear and it works fine in excel 2000. When I open the same spreadsheet in excel xp, I am getting "Run-time error '1004' unable to get teh object property of the OLEobject class' at the 'Call fBookCombobox.Object.Clear' line. In the Local window, Combobox named 'A' indeed is not there but 'B' is. If I open the file in XP with macro disabled, save it and reopen in XP again, the code works. But the down side is I gets the same error at the same line when I now open the file in excel 2000. It looks like there are some incompatibility issue ther. Has anyone seen this ? |
combobox missing between excel 2000 and xp
Dickson,
Well that eliminates bad code as the reason. Sorry, I don't know why the combobox would be missing. I was referring to removing the word "Call" from in front of the two statements. "Call" is normally used to start (transfer control to) another procedure. Regards, Jim Cone San Francisco, CA "Dickson Law" wrote in message om... Hi Jim Do you mean commenting the two call statement completely? Tried that, but got the same results. The problem seems to be the object has disappeard from the sheet "Main". So whenever I tried to do anything to the object I get the same error. Thanks dickson "Jim Cone" wrote in message ... Have you tried it without the "Call" statements? Jim Cone San Francisco, CA - snip - |
All times are GMT +1. The time now is 06:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com