Results 1 to 3 of 3

Thread: Export Data to Excel from VB

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    45
    Hi,
    I'm trying to copy information from VB6 to MS Excel which works fine until I wanted to copy information from a MSChart object. I have placed the information on the clipboard and if I manually past the information from within Excel it works just fine, but what syntax do I use to have the information past from within VB?

    This is what I have used so far:
    Set ExcelSheet = obExcelProg.Sheets(intSheetno)
    'Display the graph's heading
    ExcelSheet.Cells(1, 1).Value = lblGraphHeading.Caption
    'Copy the Chart information
    chGraph.EditCopy
    'Paste the information into Excel
    ???????

    I hope someone can help me out here,
    Thank you!


  2. #2
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    Hello jess,

    I do think you need the clipboard function of VB.

    Clipboard.Clear
    Clipboard.GetData
    Clipboard.GetFormat
    Clipboard.GetText
    Clipboard.SetData
    Clipboard.SetText

    Good luck.

    Michelle.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    45
    Thanks for answering me, but I need more information.

    I'm using:
    chGraph.EditCopy
    to copy the information to the clipboard

    and I guess I need to use:
    Clipboard.GetData()
    to paste the data into Excel, but it is the syntax for that that I need.

    I have tried things like:
    'ExcelSheet.Cells(1, 1).Value = Clipboard.GetData()
    'ExcelSheet.Range("A2:E19").Value = Clipboard.GetData()
    But I cannot get it to work.

    Hopy you Michelle or someone else can give me a hint of what I'm doing wrong.

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