Listbox Control Source Question

eddiev1972

New Member
Joined
Mar 22, 2010
Messages
38
Can the controlsource property of a listbox refer to a different workbook from where the macro resides? If so, does that workbook need to be open?

I am receiving a "Could not set the controlsource property" error when trying to do so. It is possible I just have the syntax wrong.

I am setting the controlsource property to variable called "tempstring"

TempString displays as:

“W:\Data\[1035_CompData.xls]Sheet1’!a2:f14”

(The quotes generate as part of the string)

ListBox1.ControlSource = TempString

Thanks for any assistance!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Your workbook would need to be open and I would set the RowSource, you also had an quote mark in your line not needed remove red marks

W:\Data\[1035_CompData.xls]Sheet1!a2:f14

Master!A2:A5
 
Upvote 0
Thank you for the additional information.

I actually did mean Row Source and I appreciate the help with the quotation mark!
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,521
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top