Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Save Workbook or worksheet

Hi there,

How to save a workbook or worksheet without saving the
code? I want to save a single worksheet on a workbook
with columns of data and a chart. However, a form will
pop up if saved file is open since there are code in
workbook. How do I save worksheet (or workbook)without
saving the code? Thanks in advance.

Hugh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Save Workbook or worksheet

For a worksheet: Edit menu/Move or Copy Sheet, Copy it to another workbook and
save that.

For a workbook with many sheets, all to be saved, you would have to go to the
VB Editor and remove all standard modules, forms, and classes, manually remove
all code from ThisWorkbook and Sheet modules.

On Wed, 20 Oct 2004 14:34:57 -0700, "Hugh"
wrote:

Hi there,

How to save a workbook or worksheet without saving the
code? I want to save a single worksheet on a workbook
with columns of data and a chart. However, a form will
pop up if saved file is open since there are code in
workbook. How do I save worksheet (or workbook)without
saving the code? Thanks in advance.

Hugh


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Save Workbook or worksheet

Hi Myrna,

Thanks for your reply. Let's say there is only one sheet
and I want to save. I use VBA to programatically save the
worksheet. The question is then how to programatically
remove the code and save. Thanks again.

Hugh

-----Original Message-----
For a worksheet: Edit menu/Move or Copy Sheet, Copy it to

another workbook and
save that.

For a workbook with many sheets, all to be saved, you

would have to go to the
VB Editor and remove all standard modules, forms, and

classes, manually remove
all code from ThisWorkbook and Sheet modules.

On Wed, 20 Oct 2004 14:34:57 -0700, "Hugh"


wrote:

Hi there,

How to save a workbook or worksheet without saving the
code? I want to save a single worksheet on a workbook
with columns of data and a chart. However, a form will
pop up if saved file is open since there are code in
workbook. How do I save worksheet (or workbook)without
saving the code? Thanks in advance.

Hugh


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Save Workbook or worksheet

Previously posted by Jim Rech:

http://groups.google.com/groups?thre...%40tkmsftngp07


''Needs a reference to the VB Extensibility library set
'Removes from active workbook all:
''Regular modules
''Class modules
''Userforms
''Code in sheet and workbook modules
''Non built-in references
''Excel 4 macro sheets
''Dialog sheets
Sub RemoveAllCode()
Dim VBComp As Object, AllComp As Object, ThisProj As Object
Dim ThisRef As Reference, WS As Worksheet, DLG As DialogSheet
Set ThisProj = ActiveWorkbook.VBProject
Set AllComp = ThisProj.VBComponents
For Each VBComp In AllComp
With VBComp
Select Case .Type
Case vbext_ct_StdModule, vbext_ct_ClassModule, _
vbext_ct_MSForm
AllComp.Remove VBComp
Case vbext_ct_Document
.CodeModule.DeleteLines 1, .CodeModule.CountOfLines
End Select
End With
Next
For Each ThisRef In ThisProj.References
If Not ThisRef.BuiltIn Then ThisProj.References.Remove ThisRef
Next
Application.DisplayAlerts = False
For Each WS In Excel4MacroSheets
WS.Delete
Next
For Each DLG In DialogSheets
DLG.Delete
Next
End Sub


--
Regards,
Tom Ogilvy

"Hugh" wrote in message
...
Hi Myrna,

Thanks for your reply. Let's say there is only one sheet
and I want to save. I use VBA to programatically save the
worksheet. The question is then how to programatically
remove the code and save. Thanks again.

Hugh

-----Original Message-----
For a worksheet: Edit menu/Move or Copy Sheet, Copy it to

another workbook and
save that.

For a workbook with many sheets, all to be saved, you

would have to go to the
VB Editor and remove all standard modules, forms, and

classes, manually remove
all code from ThisWorkbook and Sheet modules.

On Wed, 20 Oct 2004 14:34:57 -0700, "Hugh"


wrote:

Hi there,

How to save a workbook or worksheet without saving the
code? I want to save a single worksheet on a workbook
with columns of data and a chart. However, a form will
pop up if saved file is open since there are code in
workbook. How do I save worksheet (or workbook)without
saving the code? Thanks in advance.

Hugh


.



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
Save Worksheet as new workbook with specifics Tel Excel Discussion (Misc queries) 0 June 26th 09 12:13 PM
Save Worksheet To Master Workbook Bobzter100 Excel Discussion (Misc queries) 5 March 12th 09 01:55 AM
How do I save a worksheet within a workbook? jester Excel Discussion (Misc queries) 1 August 7th 06 10:54 PM
Save Worksheet vs Workbook Terry Excel Worksheet Functions 1 January 6th 06 05:31 PM
save worksheet as new workbook dreamer[_12_] Excel Programming 6 February 19th 04 02:56 PM


All times are GMT +1. The time now is 12:06 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"