Results 1 to 7 of 7

Thread: [RESOLVED] closing an excel file from VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    16

    Resolved [RESOLVED] closing an excel file from VB

    I am extracting a column with 8760 cells from an excel file to my graph in my vb application. I managed to open and close the excell sheet from my program. However, when I try to run my application I receive this message:

    There is a large amount of information on the clipboard do you want to be able to paste this into to another program later?

    Is there a way that I can avoid receiving this message when calling the data from the excell file?

    HOW??

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: closing an excel file from VB

    You could just try clearing the clip board.

    VB.NET Code:
    1. My.Computer.Clipboard.Clear()
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    16

    Re: closing an excel file from VB

    I tried but to paste the code in vb but nothing happened. I think I need to paste it the the excel macro that I am calling. do you know any solution?

  4. #4
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: closing an excel file from VB

    If the issue is that the clipboard is full, then clearing it will work. That means that you're not clearing in the right area.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    16

    Re: closing an excel file from VB

    Application.CutCopyMode = False

    thank you

  6. #6
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Michigan
    Posts
    304

    Re: closing an excel file from VB

    In your App, try assigning your working variables to Nothing as soon as your done with them.

    Code:
                    xlSheet = Nothing
                    xlBook = Nothing
                    xlApp = Nothing

  7. #7
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: closing an excel file from VB

    Quote Originally Posted by shadyattia View Post
    Application.CutCopyMode = False

    thank you
    Eh... whatever works

    Please mark the thread resolved by selecting it from the Thread Tools menu located near the top of the page.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

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