Results 1 to 8 of 8

Thread: Automating an excel spreadsheet (OLE)

Threaded View

  1. #6

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    Re: Automating an excel spreadsheet (OLE)

    anhn: You were right. Those lines were of no use.

    Would anyone know what .DoVerb and .Action are used for?

    Also, I used si_the_geek code to clear the excel spreadsheet, here's the code:
    Code:
        LastRow = Ole1.Object.ActiveSheet.UsedRange.Rows.Count
        LastCol = Ole1.Object.ActiveSheet.UsedRange.Columns.Count
        
        For x = 1 To LastRow
            For y = 1 To LastCol
                Ole1.Object.ActiveSheet.Cells(x, y) = ""
            Next y
        Next x
    ...this is working fine. Just wondered if I'm missing a ".clear" method or something more effective. Meanwhile I'll stick with this.

    Recap:
    1- user uses my app to filter/modify/play with data.
    2- user outputs that data to OLE spreadsheet in my app
    3- user wants to take that data and bring it in his own excel spreadsheet

    To do #3, the user enter the OLE excel spreadsheet (by double-cliking it) and manually copy the data by clicking the upperleft cell. Could this be automated?

    Something like:
    Code:
    clipboard.settext = Ole1.Object.ActiveSheet.Range("A1:J25").Value
    (I would then work the A1:J25 part more professionally as this would be dynamic - I could use .UsedRange method)

    Edit:
    This is interesting. I just tried this line of code. What it does is OPEN an instance of excel with my OLE spreadsheet data in it. That's almost it. I'd like that data to go to the clipboard, not to a new instance of excel.
    Code:
    myclip.SetText Ole1.Object.ActiveSheet.Copy
    Thanks for any feedback - you guys rocks.
    Last edited by Krass; May 4th, 2010 at 11:04 AM.
    Chris

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