OWC Spreadsheet Control

  • Thread starter Thread starter a7n9
  • Start date Start date
A

a7n9

Hello all,

I'm trying to populate a spreadsheet OWC control in a Form, but I'm getting
a Type mismatch error. Any help is appreciated.

here's the code:
Dim owcSpredSht As OWC11.Spreadsheet
Dim owcWrkBk As OWC11.Workbook
Dim owcWSht As OWC11.Worksheet

Set owcSpredSht = Me.Spreadsheet7
Set owcWrkBk = owcSpredSht.ActiveWorkbook
Set owcWSht = owcWrkBk.ActiveSheet

I'm getting an error when I'm trying to set the variable owcSpredSht with
the control.
 
Assuming Me.Spreadsheet7 is a spreadsheet control, you shouldn't really need
to instantiate owcSpredSht. Try simply using

Set owcWrkBk = Me.Spreadsheet7.ActiveWorkbook
Set owcWSht = owcWrkBk.ActiveSheet
 
Back
Top