Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write-Reserve problem...

I'm trying to overwrite a template file so that some things are change
and others are not. The template loads, values are entered, then whe
you press a userform command button, the file is saved as a .xls the
the cell contents are removed, then the file should be saved as
template, overwriting the template that is there (so some value
remain). I have it doing everything it's supposed to but it keep
saying that the template is write-reserved, but it shouldn't be, ho
can I change this so that it works? Heres a piece of the code tha
seems to be causing the snag, but I think the problem is really wit
the template, I can manually do a save as, but I want this to b
programmatic.

Code
-------------------
Worksheets("Quote").Range("Q9").ClearContents
sPath = "C:\SyntheticShield\"
ActiveWorkbook.SaveAs Filename:=sPath & "SyntheticShieldQuoteMaker.xlt", FileFormat:=xlTemplate
ActiveWorkbook.Close Fals
-------------------


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write-Reserve problem...

anybody

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write-Reserve problem...

I believe Write-Reserved refers to the file being password protected s
that if it is opened without supplying the password, it is read onl
(reserved from writing). If you have a password set on the file, tr
adding this parameter when calling the SaveAs method...

WriteResPassword:= *yourpassword*

-Gitcyphe

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write-Reserve problem...

I tried this and it is still giving me the error...


Code
-------------------
Worksheets("Quote").Range("Q9").ClearContents
ActiveWorkbook.SaveAs Filename:= _
"C:\SyntheticShield\SyntheticShieldQuoteMaker.xlt" , FileFormat:=xlTemplate, _
Password:="", WriteResPassword:="Amsoil", ReadOnlyRecommended:=False, _
CreateBackup:=Fals
-------------------


It isn't working now at all, and frankly this is more than irritating
I can save as perfectly fine by doing it manually, but programmaticall
it won't overwrite the template file, what's the difference

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write-Reserve problem...


Hmm, can't help but I'm having the same problem. I need to save a fil
in 4 different directories, all password protected (same password
times). I can do this fine with a manual saveas, but not through code
I keep getting the write reserved error.

Someone must know how to do this!

--
langere
-----------------------------------------------------------------------
langerer's Profile: http://www.msusenet.com/member.php?userid=279
View this thread: http://www.msusenet.com/t-51196



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write-Reserve problem...


If you run this piece of code first you should be OK. It checks to se
if the file already exists, and if so opens it, saves it withou
password protection, closes it then deletes it.

Not very elegant, but gets the job done.

If Len(Dir("filename")) 0 Then
Workbooks.Open "filename", writerespassword:="password"
ActiveWorkbook.SaveAs "filename", writerespassword:=""
ActiveWorkbook.Close
Kill "filename"
End I

--
langere
-----------------------------------------------------------------------
langerer's Profile: http://www.msusenet.com/member.php?userid=279
View this thread: http://www.msusenet.com/t-51196

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
Excel template to calculate capital reserve funding %?? Antrim Excel Discussion (Misc queries) 0 October 22nd 08 10:26 PM
How do I reserve a document Cathy3n Excel Worksheet Functions 0 December 17th 07 09:27 PM
attendance based pay for Army reserve Paul Excel Worksheet Functions 3 November 28th 07 05:30 PM
Problem with a UDF im trying to write CSUS_CE_Student[_2_] Excel Worksheet Functions 3 April 6th 07 01:34 PM
How do I set up a equipment replacement reserve schedule Hank Excel Worksheet Functions 0 March 30th 05 07:19 PM


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