Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default SaveAs worksheets

Is there a way to save multiple worksheet as a new wookbook without having
the vba modules included with the save?

I currently am doing the following, but this saves the vba modules as well
as the
worksheets. I just want to save the work sheets.

Private Sub Save_Dialog()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogSaveAs)
Dim vrtSelectedItem As Variant
With fd
.Filters.Add "Excel", "*.xls; *.csv; *.csv", 2
If .Show = -1 Then 'user pressed action button.
.Execute
'Application.ActiveWorkbook.SaveCopyAs (vrtSelectedItem)
Else 'The user pressed Cancel.
End If
End With
Set fd = Nothing
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default SaveAs worksheets

Hi Niek,

To create a new workbook, try:

'=============
Public Sub Tester()
ActiveWorkbook.Worksheets.Copy
End Sub
'<<=============

Only code in the sheet modules ot the ThisWorkbook
modules will be carried to the new workbook.

If your intention is to delete all code, see Chip Pearson at:

Programming To The Visual Basic Editor
http://www.cpearson.com/excel/vbe.htm


---
Regards,
Norman



"miek" wrote in message
...
Is there a way to save multiple worksheet as a new wookbook without having
the vba modules included with the save?

I currently am doing the following, but this saves the vba modules as well
as the
worksheets. I just want to save the work sheets.

Private Sub Save_Dialog()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogSaveAs)
Dim vrtSelectedItem As Variant
With fd
.Filters.Add "Excel", "*.xls; *.csv; *.csv", 2
If .Show = -1 Then 'user pressed action button.
.Execute
'Application.ActiveWorkbook.SaveCopyAs (vrtSelectedItem)
Else 'The user pressed Cancel.
End If
End With
Set fd = Nothing
End Sub



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
SaveAs - VBA Jae Excel Discussion (Misc queries) 0 April 10th 08 06:04 AM
SaveAs csv Gert Excel Programming 4 March 21st 07 12:35 PM
SaveAs Stan Halls Excel Worksheet Functions 5 November 28th 06 07:51 PM
Help with SaveAs Glen Mettler[_2_] Excel Programming 1 January 29th 04 05:32 PM
SaveAs Steve[_48_] Excel Programming 3 November 19th 03 05:11 AM


All times are GMT +1. The time now is 10:28 PM.

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

About Us

"It's about Microsoft Excel"