+ Reply to Thread
Results 1 to 8 of 8

save without code

  1. #1
    Roman Töngi
    Guest

    save without code

    Is it possible to save a document without any VBA-code included in that
    document?
    I should be achieved by VBA-programming.

    Regards,
    Roman



  2. #2
    Bob Phillips
    Guest

    Re: save without code

    You would need to remove any code.

    See Chip's page at http://www.cpearson.com/excel/vbe.htm

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Roman Töngi" <[email protected]> wrote in message
    news:%[email protected]...
    > Is it possible to save a document without any VBA-code included in that
    > document?
    > I should be achieved by VBA-programming.
    >
    > Regards,
    > Roman
    >
    >




  3. #3
    Fredrik Wahlgren
    Guest

    Re: save without code


    "Roman Töngi" <[email protected]> wrote in message
    news:%[email protected]...
    > Is it possible to save a document without any VBA-code included in that
    > document?
    > I should be achieved by VBA-programming.
    >
    > Regards,
    > Roman
    >
    >


    I guess you have to create new document and copy the contens of the doc with
    Vba code to that one. I tried to record deleting a macro only to find that
    nothing had been recorded. You're better off if you put your VBA code in an
    add-in.
    /Fredrik



  4. #4
    Tom Ogilvy
    Guest

    Re: save without code

    Look at Chip Pearson's page on programming with the VBE. I believe he has
    sample code for removing. Of course you would want to run this code from a
    different workbook than you are stripping the code out of.

    http://www.cpearson.com/excel/vbe.htm

    --
    Regards,
    Tom Ogilvy

    "Roman Töngi" <[email protected]> wrote in message
    news:%[email protected]...
    > Is it possible to save a document without any VBA-code included in that
    > document?
    > I should be achieved by VBA-programming.
    >
    > Regards,
    > Roman
    >
    >




  5. #5
    Fredrik Wahlgren
    Guest

    Re: save without code


    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > Look at Chip Pearson's page on programming with the VBE. I believe he has
    > sample code for removing. Of course you would want to run this code from

    a
    > different workbook than you are stripping the code out of.
    >
    > http://www.cpearson.com/excel/vbe.htm
    >
    > --
    > Regards,
    > Tom Ogilvy
    >


    How funny. I just found this link when i was researching something else. It
    seems as if I was wrong. However, you can't create a self destructing macro.

    /Fredrik



  6. #6
    Chip Pearson
    Guest

    Re: save without code

    > However, you can't create a self destructing macro.
    Yes you can. Try the following:

    Sub SelfDestruct()
    '
    ' some code
    '
    With
    ThisWorkbook.VBProject.VBComponents("Module1").CodeModule
    .DeleteLines .ProcBodyLine("SelfDestruct",
    vbext_pk_Proc), _
    .ProcCountLines("SelfDestruct", vbext_pk_Proc)
    End With

    End Sub


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Fredrik Wahlgren" <[email protected]> wrote
    in message news:[email protected]...
    >
    > "Tom Ogilvy" <[email protected]> wrote in message
    > news:[email protected]...
    >> Look at Chip Pearson's page on programming with the VBE. I
    >> believe he has
    >> sample code for removing. Of course you would want to run
    >> this code from

    > a
    >> different workbook than you are stripping the code out of.
    >>
    >> http://www.cpearson.com/excel/vbe.htm
    >>
    >> --
    >> Regards,
    >> Tom Ogilvy
    >>

    >
    > How funny. I just found this link when i was researching
    > something else. It
    > seems as if I was wrong. However, you can't create a self
    > destructing macro.
    >
    > /Fredrik
    >
    >




  7. #7
    Tom Ogilvy
    Guest

    Re: save without code

    To Fredrik:

    and of course I said: Of course you would want to run this code from a
    different workbook than you are stripping the code out of.

    --
    Regards,
    Tom Ogilvy

    "Chip Pearson" <[email protected]> wrote in message
    news:[email protected]...
    > > However, you can't create a self destructing macro.

    > Yes you can. Try the following:
    >
    > Sub SelfDestruct()
    > '
    > ' some code
    > '
    > With
    > ThisWorkbook.VBProject.VBComponents("Module1").CodeModule
    > .DeleteLines .ProcBodyLine("SelfDestruct",
    > vbext_pk_Proc), _
    > .ProcCountLines("SelfDestruct", vbext_pk_Proc)
    > End With
    >
    > End Sub
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    >
    > "Fredrik Wahlgren" <[email protected]> wrote
    > in message news:[email protected]...
    > >
    > > "Tom Ogilvy" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> Look at Chip Pearson's page on programming with the VBE. I
    > >> believe he has
    > >> sample code for removing. Of course you would want to run
    > >> this code from

    > > a
    > >> different workbook than you are stripping the code out of.
    > >>
    > >> http://www.cpearson.com/excel/vbe.htm
    > >>
    > >> --
    > >> Regards,
    > >> Tom Ogilvy
    > >>

    > >
    > > How funny. I just found this link when i was researching
    > > something else. It
    > > seems as if I was wrong. However, you can't create a self
    > > destructing macro.
    > >
    > > /Fredrik
    > >
    > >

    >
    >




  8. #8
    Fredrik Wahlgren
    Guest

    Re: save without code


    "Chip Pearson" <[email protected]> wrote in message
    news:[email protected]...
    > > However, you can't create a self destructing macro.

    > Yes you can. Try the following:
    >
    > Sub SelfDestruct()
    > '
    > ' some code
    > '
    > With
    > ThisWorkbook.VBProject.VBComponents("Module1").CodeModule
    > .DeleteLines .ProcBodyLine("SelfDestruct",
    > vbext_pk_Proc), _
    > .ProcCountLines("SelfDestruct", vbext_pk_Proc)
    > End With
    >
    > End Sub
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >


    Cool! I will try this out!
    /Fredrik



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1