Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Preserve original workbook, but add new sheet?

In an addin's routine, user navigates and chooses a workbook
to be opened by the code (I know a copy has been opened).

I would like to be sure that when that book is closed, the
only acceptable change is the addition of a new code-created
sheet.

I can only see the following option:

open the workbook (say "testbook")
SaveAs "1" & "testbook"
Close "1" & "testbook" (perhaps not neccessary)
Open "testbook"
Do all the code
Create the new sheet
Open "1" & "testbook"
Add the new sheet to it
use DisplayAlerts=False
SaveAs "testbook"

Does this seem feasible and/or is there a better way, please?

Regards.




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Preserve original workbook, but add new sheet?

..Use
Thisworkbook.SaveCopyAs

then do basically what you said.


--
Regards,
Tom Ogilvy


Stuart wrote in message
...
In an addin's routine, user navigates and chooses a workbook
to be opened by the code (I know a copy has been opened).

I would like to be sure that when that book is closed, the
only acceptable change is the addition of a new code-created
sheet.

I can only see the following option:

open the workbook (say "testbook")
SaveAs "1" & "testbook"
Close "1" & "testbook" (perhaps not neccessary)
Open "testbook"
Do all the code
Create the new sheet
Open "1" & "testbook"
Add the new sheet to it
use DisplayAlerts=False
SaveAs "testbook"

Does this seem feasible and/or is there a better way, please?

Regards.




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Preserve original workbook, but add new sheet?

Many thanks,

Regards.

"Tom Ogilvy" wrote in message
...
.Use
Thisworkbook.SaveCopyAs

then do basically what you said.


--
Regards,
Tom Ogilvy


Stuart wrote in message
...
In an addin's routine, user navigates and chooses a workbook
to be opened by the code (I know a copy has been opened).

I would like to be sure that when that book is closed, the
only acceptable change is the addition of a new code-created
sheet.

I can only see the following option:

open the workbook (say "testbook")
SaveAs "1" & "testbook"
Close "1" & "testbook" (perhaps not neccessary)
Open "testbook"
Do all the code
Create the new sheet
Open "1" & "testbook"
Add the new sheet to it
use DisplayAlerts=False
SaveAs "testbook"

Does this seem feasible and/or is there a better way, please?

Regards.




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003


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
Copy Sheet to new Sheet and clear cells on original sheets Boiler-Todd Excel Discussion (Misc queries) 7 September 23rd 09 10:02 PM
???Replicate a sheet but chart still link to original sheet Jaylin Charts and Charting in Excel 1 October 9th 06 03:14 PM
how can I paste to a different workbook without formula refrencing the original sheet [email protected] New Users to Excel 3 May 29th 06 11:50 AM
Original Workbook maximus73 Excel Discussion (Misc queries) 0 March 22nd 06 09:41 PM
HOW DO I PRESERVE FORMATTING WHEN PASTING INTO A NEW WORKBOOK? wamorgan1956 Excel Discussion (Misc queries) 4 April 13th 05 12:47 PM


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