Results 1 to 9 of 9

Thread: do i need to need to clear(set to nothing) an OLE link

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    do i need to need to clear(set to nothing) an OLE link

    Hello

    I was wondering if i needed to clear (set to nothing) an OLE link.
    I have the following code

    VB Code:
    1. link = "c:\mycars\fastcars.xls!output!R6C2:R38C3" 'fixed for phase1
    2.     OLE2.CreateLink (link)


    do i need to do

    set OLE2 = nothing or set link = nothing in the form_unload method?

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: do i need to need to clear(set to nothing) an OLE link

    How is OLE2 defined?

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: do i need to need to clear(set to nothing) an OLE link

    Someone with more experience in using OLE Links could be more definitive. This is just an opinion, but it couldn't hurt.

  4. #4
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: do i need to need to clear(set to nothing) an OLE link

    Set your OLE object to nothing after you are done with it. Do make sure you actually close your workspace if you are using any office OLE functionality or risk either pop ups from Office or losing data.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: do i need to need to clear(set to nothing) an OLE link

    hack, i got little experience with OLE's

    the OLE is an embedded link(?) in one of my forms, it is
    a class Excel.Sheet.8

    how do you set your OLE pbject to nothing

    what do you mean by closing the workspace?

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: do i need to need to clear(set to nothing) an OLE link

    Use the .Close method, or something like it.

    To set it to nothing, you posted the code yourself

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: do i need to need to clear(set to nothing) an OLE link

    you mean to say i should do the following

    VB Code:
    1. OLE2.close
    2. set OLE2 = nothing

    ?

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: do i need to need to clear(set to nothing) an OLE link

    Quote Originally Posted by vb_student
    you mean to say i should do the following

    VB Code:
    1. OLE2.close
    2. set OLE2 = nothing

    ?
    Yes.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: do i need to need to clear(set to nothing) an OLE link

    i guess if i dont close the OLE2 it will take up memory?

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