Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default SAVING A COPY OF WORKBOOK W/O THE CODE IN IT

Hi,

Suppose i hv a workbook with code in to generate Unique alphanumeric no
e.g. a unique Receipt voucher # for a Receipt voucher workbook which anybody
can save a copy & print.
I want to save the workbook as another workbook with only the copy of the
selected worksheet e.g Sheet1 & not other sheets in the original workbook &
OFCOURSE, I donot want the code written in original workbook to also get
saved in the copies.

I am having trouble using the function SaveAscopy in VBA as it saves exactly
a duplicate copy of the original workbook along with the code. bcos of which
each file has the original BIG filesize which i donot want.

is there a way to copy the contents of Sheet1 original workbook as a new
workbook with ONLY Sheet1 & without the code written inside.

Can I use .Copy to copy Selected contents of Worksheet1 of original workbook
as a new SMALL (KByte) size workbook with only workSheet1 & not with the
code written so that nobody else can use the new workbook to generate his
own autonumber but will have to use the original workbook to generate the
next unique aplhanumeric number .

Pls note that the coding is given in the POSTing "Unique Generated
Alphanumeric no.". any help to help me to improve the code will be really
appreciated, as i knw that i have md a lot of errors & want them rectified
before i can use it ofc to generate their own unique receipt voucher.

Thanks & regards

Eijaz



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SAVING A COPY OF WORKBOOK W/O THE CODE IN IT

You can try to remove the modules from the workbook, after you save the
workbook with SaveAs method,

or you can try to create a new workbook and copy the selected sheets to
the new wb.


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default SAVING A COPY OF WORKBOOK W/O THE CODE IN IT

Hi,
This will create a new workbook and copy the active sheet of your
workbook containing the code to it. ThisWorkBook is VBA speak for the
workbook that contains the code

Public Sub MakeNewBook()
Dim FreshWorkBook As New Workbook 'workbook created
Application.ScreenUpdating = False 'speed things up

Set FreshWorkBook = Workbooks.Add
With FreshWorkBook
ThisWorkbook.Activesheet.Copy befo=.Sheets(1)
.Protect Password:="mypassword" 'optional
End With
End Sub

Your new workbook is now active and you can save as...

regards
Paul
"gr8guy" wrote in message ...
Hi,

Suppose i hv a workbook with code in to generate Unique alphanumeric no
e.g. a unique Receipt voucher # for a Receipt voucher workbook which anybody
can save a copy & print.
I want to save the workbook as another workbook with only the copy of the
selected worksheet e.g Sheet1

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
reset a workbook each month saving a copy and using totals to rest squirrel12 Excel Discussion (Misc queries) 1 July 2nd 08 06:13 AM
copy and paste using code from workbook to workbook bigdaddy3 Excel Discussion (Misc queries) 2 September 14th 05 11:06 AM
Copy Macros and VB code from one workbook to another Dawn[_2_] Excel Programming 1 December 2nd 03 11:03 PM
Saving a Workbook without code KimberlyC Excel Programming 1 August 21st 03 07:07 PM
Copy VB code to other workbook? john Dijkman Excel Programming 3 July 21st 03 01:02 AM


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