ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo box problem (https://www.excelbanter.com/excel-programming/344153-combo-box-problem.html)

jellobze1

Combo box problem
 

HI.

I'm using Excel VBA. I have a combo box in a template sheet with th
fillrange set to a range in a separate data sheet in another workbook
workbook1. The combo box reads fine when I open both workbook
separately and manually but when I use a command button from Workbook
to open the template the combo box no longer shows my options.

I'm thinking the combo box needs to be refreshed after I open th
template. Is there any way to do this, since I trie
activesheet.cboChoose.refresh and got an error that "this objec
doesn't support this property or method". I even trie
activesheet.cboChoose.requery and got the same error.

Any other ideas would be greatly appreciated.

Thanks in advance.
Angel

--
jellobze
-----------------------------------------------------------------------
jellobze1's Profile: http://www.excelforum.com/member.php...fo&userid=2843
View this thread: http://www.excelforum.com/showthread.php?threadid=48024


Tom Ogilvy

Combo box problem
 
Believe the source workbook will need to be opened. Comboboxes know nothing
about external links to closed workbooks.

--
Regards,
Tom Ogilvy


"jellobze1" wrote
in message ...

HI.

I'm using Excel VBA. I have a combo box in a template sheet with the
fillrange set to a range in a separate data sheet in another workbook,
workbook1. The combo box reads fine when I open both workbooks
separately and manually but when I use a command button from Workbook1
to open the template the combo box no longer shows my options.

I'm thinking the combo box needs to be refreshed after I open the
template. Is there any way to do this, since I tried
activesheet.cboChoose.refresh and got an error that "this object
doesn't support this property or method". I even tried
activesheet.cboChoose.requery and got the same error.

Any other ideas would be greatly appreciated.

Thanks in advance.
Angelo


--
jellobze1
------------------------------------------------------------------------
jellobze1's Profile:

http://www.excelforum.com/member.php...o&userid=28431
View this thread: http://www.excelforum.com/showthread...hreadid=480245




jellobze1[_2_]

Combo box problem
 

Tom, thanks for the reply. i found the problem. in my VB code i was
opening a new application and not using the same one already opened.
(XLAPP = new excel.application) In this new XLAPP is where i would then
open the new file. (XLAPP.workbooks.open(File)).
For some reason, although the other application and source workbook
remained opened, it would not load the combo box's source data.
Now i just open the new file in the same application window and it
works just fine.
Thanks for your input.

Angelo


--
jellobze1
------------------------------------------------------------------------
jellobze1's Profile: http://www.excelforum.com/member.php...o&userid=28431
View this thread: http://www.excelforum.com/showthread...hreadid=480245



All times are GMT +1. The time now is 11:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com