+ Reply to Thread
Results 1 to 5 of 5

Spreadsheet control

  1. #1
    Registered User
    Join Date
    05-05-2009
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Spreadsheet control

    I have a spreadsheet control inside of a userform. I can generally access this spreadsheet and do what I need to do with it. My problem is that I need to monitor it for the cell change event. I normally accomplish this with:

    Please Login or Register  to view this content.
    in the 'code' portion of the particular worksheet that I want to monitor. I have the same thing in the spreadsheet object that I have inserted onto the userform, but the event never gets triggered.

    Any ideas?
    Last edited by gtmeloney; 06-16-2009 at 05:36 PM.

  2. #2
    Registered User
    Join Date
    05-05-2009
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Spreadsheet control

    I think what I really need to do is put a Worksheet in the userform, as opposed to the Spreadsheet that I'm currently using. (I believe a spreadsheet is composed of 1 or many Worksheets). There is no Worksheet control though, is there another way to embed a worksheet inside of a userform?

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Spreadsheet control

    Hello gtmeloney,

    If you are using a OCW spreadsheet control then use the Private Sub Spreadsheet1_SheetChange(ByVal Sh As OWC11.Worksheet, ByVal Target As OWC11.Range) event. This code is for the Excel 2003 OCW control.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    05-05-2009
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Spreadsheet control

    Thanks Leith. That does the trick.

    Does OWC11 tell VB that we're dealing with an ActiveX object as opposed to a regular old Excel object?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Spreadsheet control

    Hello gtmeloney,

    Yes, it dioes. There are some properties that similar to an Excel worksheet. So, it is a good practice to qualify those properties and methods with the object class name OCW11, so VBA doesn't reference the wrong object.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1