ControlSource Compatibility VBA - VB6

  • Thread starter Thread starter John M
  • Start date Start date
J

John M

Hello and Help:

I wrote VBA code (Excel 2000 SR1) which connected UserForms with
textboxes to worksheet cells. In a moment of insanity, I decided to
also convert this to VB6. Now, after successfully “getting” an existing
Excel Workbook, the ControlSource property is problematic – except
possibly for those cells which were originally null. The Error
encountered is that “Could not set the ControlSource property. Invalid
property value.” Do I need a different syntax for referring to a
Worksheet Cell? There are no spaces or other “unacceptable” characters
in the sheet name. Am I inheriting a restriction? These are UserForms
in the Designer Folder of vb6. They are not VB6 Forms.

As an example:

frmInputCompletion.txtWHwrtRT.ControlSource = xlSheet.Range("C3")

gives an error.

Any help would be greatly appreciated.

Sincerely

John M.
 
John,


rowsource/controlsource need a string, so you'd have to give the range's
address. to be safe i'd advise you to give it a fully qualified adress.

assuming xlsheet is a worksheet variable..
==> xlsheet.Range("c3").address(external:=true)

keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Dear keepITcool:
Thanks for the advice. I tried this and I am still receiving the same
error. I can see that it is pointing to the correct worksheet cell. It
seems more insidious! As I try it now, I am even having trouble with
these UserForms in design view in the VB6 DE. If you have any other
suggestions, they would be appreciated.

John M.
 
Back
Top