Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default save without code


"Roman Töngi" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default save without code


"Tom Ogilvy" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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").Cod eModule
.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" wrote
in message ...

"Tom Ogilvy" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
However, you can't create a self destructing macro.

Yes you can. Try the following:

Sub SelfDestruct()
'
' some code
'
With
ThisWorkbook.VBProject.VBComponents("Module1").Cod eModule
.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" wrote
in message ...

"Tom Ogilvy" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default save without code


"Chip Pearson" wrote in message
...
However, you can't create a self destructing macro.

Yes you can. Try the following:

Sub SelfDestruct()
'
' some code
'
With
ThisWorkbook.VBProject.VBComponents("Module1").Cod eModule
.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
code works - need to save Ted Roche Excel Discussion (Misc queries) 1 January 7th 09 06:08 PM
Before Save code Kelly Excel Worksheet Functions 4 January 30th 08 03:57 PM
How to save my VBA-code Heine Excel Worksheet Functions 4 September 26th 06 05:46 PM
VBA Code to save to 2 locations Sinjin341[_5_] Excel Programming 0 October 13th 04 07:18 PM
VBA Code to save to 2 locations Sinjin341[_4_] Excel Programming 2 October 13th 04 01:58 PM


All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"