Results 1 to 8 of 8

Thread: Embeded Excel Objects

  1. #1

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550
    So I right-click on my toolbox and left-click on Components, and there's a tab called "Insertable Objects", from which you can select, amongst other things, "Microsoft Excel Worksheet". And you can then paint an excel sheet onto your form. But then how the hell do you get at it's properties (like normal Excel ones - Range etc., not the fifteen that it gives you automatically)?

    I think I'd really like to be able to use this feature, but damned if I can figure out how.

    HDR has been a great deal of help to me, but unfortunately not with embedded (am I using the right terminology here?) sheets. Thanks HDR!!!

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    Using an Excel control sounds really neat, and I would like to find out about it so I can use it. But I sure can't find anything out about it. I've searched MSDN, and the microsoft web sites, not a single hit. I have also looked at it's properties, methods, and events. Nothing useful there either. My guess is that it probably is there for some specific internal-to-Microsoft use that isn't really documented. I'm checking the office 2000 developer cd next. I'll let you know if I find anything.

  3. #3
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    Nothing on the Office 2000 developer resource kit CDs or on the MSDN Office 2000 developer libraries. I think you are out of luck. Sorry.

  4. #4

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550
    Cheers HDR! Shame eh? Oh well, the other method you told me works fine anyway. Do you know if it's poss for me to edit a worksheet in that way and then open it within a vb form? I'm a control freak, you see, can't let them evil users get to messing with things they shouldn't.
    Thanks again!

  5. #5
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337
    I'm interested in this too....how are you adding the Excel sheet?

    I keep getting 'System error &H80070001 (-2147024895)'

    I can insert word documents and excel graphs but not sheets?

    Can you help me?




    Dan

  6. #6

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550
    Judd, I assume you're not talking about the "painting the sheet on the form" bit, so here is the way HDR showed me to edit a new excel sheet (sort of external to VB).

    Private xlOut As Excel.Application

    Set xlOut = CreateObject("Excel.Application")
    ' You put in path and file name.
    xlOut.Workbooks.Open xlOutPath & xlOutFileName & ".xls"
    ' If you want to see it, uncomment.
    'xlOut.Visible = True
    ' You put in the name of the worksheet,
    xlOut.Worksheets(xlOutWorkSheetName).Activate
    ' and the row and column.
    xlOut.Worksheets(xlOutWorkSheetName).Cells(intOutRow, intOutColumn) = Data
    xlOut.ActiveWorkbook.Close SaveChanges:=True
    Set xlOut = Nothing
    xlOut.Quit

  7. #7
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337
    Actually, I was

    I've create external excel sheets before, by the method you mention (thanks anyway).

    I can't add the control to the form...strange because I can add a chart which apparently uses the same control...(and includes a sheet!!!!!)




    Dan

  8. #8

    API

    Shirley there's an API for you to screenshoot the Excel window and get an hDC for it, or if you have to, pick up the .bmp off the disk and paint it or put it in frm*.Picture...Shirley...



Posting Permissions

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



Click Here to Expand Forum to Full Width