Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Copy workbook, don't copy macro

Is it possible to copy a workbook but not the macro?

Backround - I have created a workbook which receives transferspreadsheet
data from Access. I have an Excel macro which formats the sheet, then
deletes the transferspreadsheet sheet. I want the user to be able to save
this report with the current date, but not copy the macro to the new sheet.

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Copy workbook, don't copy macro

Add code to your macro to move the formatted sheet into a new workbook,
change the MyNewWorkbook.xls to the name you want the new file to have and
the FormattedSheet.xls name to the name of the workbook that contains the
macro:

Application.Workbooks.Add
ActiveWorkbook.SaveAs "MyNewWorkbook.xls"
Application.Workbooks("FormattedSheet.xls").Sheets (1).Activate
Sheets(1).Activate
ActiveSheet.Move Befo=Workbooks("MyNewWorkbook.xls").Sheets(1)

--
Kevin Backmann


"CongroGrey" wrote:

Is it possible to copy a workbook but not the macro?

Backround - I have created a workbook which receives transferspreadsheet
data from Access. I have an Excel macro which formats the sheet, then
deletes the transferspreadsheet sheet. I want the user to be able to save
this report with the current date, but not copy the macro to the new sheet.

Is this possible?

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
Macro to copy values to Workbook KCG Excel Discussion (Misc queries) 10 November 6th 07 10:52 PM
Macro to Copy From One Workbook To Another [email protected] Excel Discussion (Misc queries) 3 June 25th 07 02:48 AM
How can I copy a macro into another workbook? jbeene New Users to Excel 4 March 15th 07 06:53 PM
Copy macro to another workbook FTM Excel Discussion (Misc queries) 4 September 21st 06 08:48 PM
copy text from 1 workbook to another by macro bigdaddy3 Excel Worksheet Functions 0 August 17th 05 06:20 PM


All times are GMT +1. The time now is 04:10 AM.

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"