Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Savecopyas without password

I have an Excel workbook which requires a password to open. I need to
savecopyas but when opening the copy (which is read only) not require a
password.


  #2   Report Post  
Posted to microsoft.public.excel.misc
ed ed is offline
external usenet poster
 
Posts: 82
Default Savecopyas without password

On Jul 1, 6:56*pm, Ray Clark
wrote:
I have an Excel workbook which requires a password to open. *I need to
savecopyas but when opening the copy (which is read only) not require a
password.


When you close the copy it wil ask for a password. Just skip through
with no entry and there wil be no password.affixed and henc none
required to reopen THAT "save as".

ed
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Savecopyas without password

If you don't care about losing the original workbook's password or know the
password to reapply it, you can use code like:

Option Explicit
Sub testme()

Dim CurWkbk As Workbook
Dim myFileName As String
Dim PWD As String

myFileName = "C:\book2222.xls"
PWD = "a"

Set CurWkbk = ActiveWorkbook

With CurWkbk
'remove the password to open
.Password = ""

'do the savecopyas
.SaveCopyAs Filename:=myFileName

'reapply the password
.Password = PWD

End With

End Sub



Ray Clark wrote:

I have an Excel workbook which requires a password to open. I need to
savecopyas but when opening the copy (which is read only) not require a
password.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Savecopyas without password

Dave,

Tried adding some extra code to remove the password prior to saving the copy
but when opening it still has the password.
This is the coding I have been using........
Private Sub Back_Up_Button_Click()
RQ1 = MsgBox("Save Maintenance Day Roster?", vbYesNo, "SAVE")
If RQ1 = vbYes Then
ActiveWorkbook.Save
With ActiveWorkbook
.Password = ""
End With
RQ2 = MsgBox("Save Copy for Viewing?", vbYesNo, "SAVE COPY")
If RQ2 = vbYes Then
RQ3 = MsgBox("Copy saved as 'Maint Day Roster for Viewing' and
Closed", vbOKOnly, "SAVE CLOSE Copy")
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbNormal
ActiveWorkbook.SaveCopyAs "N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls"
Workbooks.Open Filename:="N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls", _
UpdateLinks:=0
ActiveSheet.Shapes("Back_Up_Button").Select
Selection.Cut
ActiveWorkbook.Save
ActiveWorkbook.Close
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbReadOnly
ElseIf RQ2 = vbNo Then
RQ2A = MsgBox("Close Maint Day Roster?", vbYesNo, "CLOSE")
If RQ2A = vbYes Then
ActiveWorkbook.Close
End If
End If
RQ4 = MsgBox("CLOSE File?", vbYesNo, "CLOSE FILE")
If RQ4 = vbYes Then
ActiveWorkbook.Close
End If
ElseIf RQ1 = vbNo Then
RQ1A = MsgBox("Close File No Save", vbYesNo, "CLOSE FILE DON'T SAVE")
If RQ1A = vbYes Then
ActiveWorkbook.Close
End If
End If
End Sub

Any suggestions.
Thanks Ray

"Dave Peterson" wrote:

If you don't care about losing the original workbook's password or know the
password to reapply it, you can use code like:

Option Explicit
Sub testme()

Dim CurWkbk As Workbook
Dim myFileName As String
Dim PWD As String

myFileName = "C:\book2222.xls"
PWD = "a"

Set CurWkbk = ActiveWorkbook

With CurWkbk
'remove the password to open
.Password = ""

'do the savecopyas
.SaveCopyAs Filename:=myFileName

'reapply the password
.Password = PWD

End With

End Sub



Ray Clark wrote:

I have an Excel workbook which requires a password to open. I need to
savecopyas but when opening the copy (which is read only) not require a
password.


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Savecopyas without password

When you tested without the extra code, did it work correctly?


Ray Clark wrote:

Dave,

Tried adding some extra code to remove the password prior to saving the copy
but when opening it still has the password.
This is the coding I have been using........
Private Sub Back_Up_Button_Click()
RQ1 = MsgBox("Save Maintenance Day Roster?", vbYesNo, "SAVE")
If RQ1 = vbYes Then
ActiveWorkbook.Save
With ActiveWorkbook
.Password = ""
End With
RQ2 = MsgBox("Save Copy for Viewing?", vbYesNo, "SAVE COPY")
If RQ2 = vbYes Then
RQ3 = MsgBox("Copy saved as 'Maint Day Roster for Viewing' and
Closed", vbOKOnly, "SAVE CLOSE Copy")
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbNormal
ActiveWorkbook.SaveCopyAs "N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls"
Workbooks.Open Filename:="N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls", _
UpdateLinks:=0
ActiveSheet.Shapes("Back_Up_Button").Select
Selection.Cut
ActiveWorkbook.Save
ActiveWorkbook.Close
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbReadOnly
ElseIf RQ2 = vbNo Then
RQ2A = MsgBox("Close Maint Day Roster?", vbYesNo, "CLOSE")
If RQ2A = vbYes Then
ActiveWorkbook.Close
End If
End If
RQ4 = MsgBox("CLOSE File?", vbYesNo, "CLOSE FILE")
If RQ4 = vbYes Then
ActiveWorkbook.Close
End If
ElseIf RQ1 = vbNo Then
RQ1A = MsgBox("Close File No Save", vbYesNo, "CLOSE FILE DON'T SAVE")
If RQ1A = vbYes Then
ActiveWorkbook.Close
End If
End If
End Sub

Any suggestions.
Thanks Ray

"Dave Peterson" wrote:

If you don't care about losing the original workbook's password or know the
password to reapply it, you can use code like:

Option Explicit
Sub testme()

Dim CurWkbk As Workbook
Dim myFileName As String
Dim PWD As String

myFileName = "C:\book2222.xls"
PWD = "a"

Set CurWkbk = ActiveWorkbook

With CurWkbk
'remove the password to open
.Password = ""

'do the savecopyas
.SaveCopyAs Filename:=myFileName

'reapply the password
.Password = PWD

End With

End Sub



Ray Clark wrote:

I have an Excel workbook which requires a password to open. I need to
savecopyas but when opening the copy (which is read only) not require a
password.


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Savecopyas without password

No Dave did not work
Ray

"Dave Peterson" wrote:

When you tested without the extra code, did it work correctly?


Ray Clark wrote:

Dave,

Tried adding some extra code to remove the password prior to saving the copy
but when opening it still has the password.
This is the coding I have been using........
Private Sub Back_Up_Button_Click()
RQ1 = MsgBox("Save Maintenance Day Roster?", vbYesNo, "SAVE")
If RQ1 = vbYes Then
ActiveWorkbook.Save
With ActiveWorkbook
.Password = ""
End With
RQ2 = MsgBox("Save Copy for Viewing?", vbYesNo, "SAVE COPY")
If RQ2 = vbYes Then
RQ3 = MsgBox("Copy saved as 'Maint Day Roster for Viewing' and
Closed", vbOKOnly, "SAVE CLOSE Copy")
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbNormal
ActiveWorkbook.SaveCopyAs "N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls"
Workbooks.Open Filename:="N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls", _
UpdateLinks:=0
ActiveSheet.Shapes("Back_Up_Button").Select
Selection.Cut
ActiveWorkbook.Save
ActiveWorkbook.Close
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbReadOnly
ElseIf RQ2 = vbNo Then
RQ2A = MsgBox("Close Maint Day Roster?", vbYesNo, "CLOSE")
If RQ2A = vbYes Then
ActiveWorkbook.Close
End If
End If
RQ4 = MsgBox("CLOSE File?", vbYesNo, "CLOSE FILE")
If RQ4 = vbYes Then
ActiveWorkbook.Close
End If
ElseIf RQ1 = vbNo Then
RQ1A = MsgBox("Close File No Save", vbYesNo, "CLOSE FILE DON'T SAVE")
If RQ1A = vbYes Then
ActiveWorkbook.Close
End If
End If
End Sub

Any suggestions.
Thanks Ray

"Dave Peterson" wrote:

If you don't care about losing the original workbook's password or know the
password to reapply it, you can use code like:

Option Explicit
Sub testme()

Dim CurWkbk As Workbook
Dim myFileName As String
Dim PWD As String

myFileName = "C:\book2222.xls"
PWD = "a"

Set CurWkbk = ActiveWorkbook

With CurWkbk
'remove the password to open
.Password = ""

'do the savecopyas
.SaveCopyAs Filename:=myFileName

'reapply the password
.Password = PWD

End With

End Sub



Ray Clark wrote:

I have an Excel workbook which requires a password to open. I need to
savecopyas but when opening the copy (which is read only) not require a
password.

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Savecopyas without password

What happened when you ran the small version of the macro and then opened the
workbook manually?

Wasn't the password to open prompt gone?

Ray Clark wrote:

No Dave did not work
Ray

"Dave Peterson" wrote:

When you tested without the extra code, did it work correctly?


Ray Clark wrote:

Dave,

Tried adding some extra code to remove the password prior to saving the copy
but when opening it still has the password.
This is the coding I have been using........
Private Sub Back_Up_Button_Click()
RQ1 = MsgBox("Save Maintenance Day Roster?", vbYesNo, "SAVE")
If RQ1 = vbYes Then
ActiveWorkbook.Save
With ActiveWorkbook
.Password = ""
End With
RQ2 = MsgBox("Save Copy for Viewing?", vbYesNo, "SAVE COPY")
If RQ2 = vbYes Then
RQ3 = MsgBox("Copy saved as 'Maint Day Roster for Viewing' and
Closed", vbOKOnly, "SAVE CLOSE Copy")
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbNormal
ActiveWorkbook.SaveCopyAs "N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls"
Workbooks.Open Filename:="N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls", _
UpdateLinks:=0
ActiveSheet.Shapes("Back_Up_Button").Select
Selection.Cut
ActiveWorkbook.Save
ActiveWorkbook.Close
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbReadOnly
ElseIf RQ2 = vbNo Then
RQ2A = MsgBox("Close Maint Day Roster?", vbYesNo, "CLOSE")
If RQ2A = vbYes Then
ActiveWorkbook.Close
End If
End If
RQ4 = MsgBox("CLOSE File?", vbYesNo, "CLOSE FILE")
If RQ4 = vbYes Then
ActiveWorkbook.Close
End If
ElseIf RQ1 = vbNo Then
RQ1A = MsgBox("Close File No Save", vbYesNo, "CLOSE FILE DON'T SAVE")
If RQ1A = vbYes Then
ActiveWorkbook.Close
End If
End If
End Sub

Any suggestions.
Thanks Ray

"Dave Peterson" wrote:

If you don't care about losing the original workbook's password or know the
password to reapply it, you can use code like:

Option Explicit
Sub testme()

Dim CurWkbk As Workbook
Dim myFileName As String
Dim PWD As String

myFileName = "C:\book2222.xls"
PWD = "a"

Set CurWkbk = ActiveWorkbook

With CurWkbk
'remove the password to open
.Password = ""

'do the savecopyas
.SaveCopyAs Filename:=myFileName

'reapply the password
.Password = PWD

End With

End Sub



Ray Clark wrote:

I have an Excel workbook which requires a password to open. I need to
savecopyas but when opening the copy (which is read only) not require a
password.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Savecopyas without password

Dave,

When it gets to opening the copy to remove the button it requests the
password to open.

Ray

"Dave Peterson" wrote:

When you tested without the extra code, did it work correctly?


Ray Clark wrote:

Dave,

Tried adding some extra code to remove the password prior to saving the copy
but when opening it still has the password.
This is the coding I have been using........
Private Sub Back_Up_Button_Click()
RQ1 = MsgBox("Save Maintenance Day Roster?", vbYesNo, "SAVE")
If RQ1 = vbYes Then
ActiveWorkbook.Save
With ActiveWorkbook
.Password = ""
End With
RQ2 = MsgBox("Save Copy for Viewing?", vbYesNo, "SAVE COPY")
If RQ2 = vbYes Then
RQ3 = MsgBox("Copy saved as 'Maint Day Roster for Viewing' and
Closed", vbOKOnly, "SAVE CLOSE Copy")
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbNormal
ActiveWorkbook.SaveCopyAs "N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls"
Workbooks.Open Filename:="N:\MaintCo-ord\Mech\Maint Day Roster
for Viewing.xls", _
UpdateLinks:=0
ActiveSheet.Shapes("Back_Up_Button").Select
Selection.Cut
ActiveWorkbook.Save
ActiveWorkbook.Close
SetAttr "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls",
vbReadOnly
ElseIf RQ2 = vbNo Then
RQ2A = MsgBox("Close Maint Day Roster?", vbYesNo, "CLOSE")
If RQ2A = vbYes Then
ActiveWorkbook.Close
End If
End If
RQ4 = MsgBox("CLOSE File?", vbYesNo, "CLOSE FILE")
If RQ4 = vbYes Then
ActiveWorkbook.Close
End If
ElseIf RQ1 = vbNo Then
RQ1A = MsgBox("Close File No Save", vbYesNo, "CLOSE FILE DON'T SAVE")
If RQ1A = vbYes Then
ActiveWorkbook.Close
End If
End If
End Sub

Any suggestions.
Thanks Ray

"Dave Peterson" wrote:

If you don't care about losing the original workbook's password or know the
password to reapply it, you can use code like:

Option Explicit
Sub testme()

Dim CurWkbk As Workbook
Dim myFileName As String
Dim PWD As String

myFileName = "C:\book2222.xls"
PWD = "a"

Set CurWkbk = ActiveWorkbook

With CurWkbk
'remove the password to open
.Password = ""

'do the savecopyas
.SaveCopyAs Filename:=myFileName

'reapply the password
.Password = PWD

End With

End Sub



Ray Clark wrote:

I have an Excel workbook which requires a password to open. I need to
savecopyas but when opening the copy (which is read only) not require a
password.

--

Dave Peterson


--

Dave Peterson

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
password on a tab jackrobyn1 Excel Discussion (Misc queries) 1 June 8th 08 11:17 PM
SaveCopyAs with a twist Rookie 1st class Excel Discussion (Misc queries) 5 January 21st 07 12:33 AM
How to see macro code of a password protected macro without a password? Dmitry Kopnichev Excel Worksheet Functions 5 October 27th 05 09:57 AM
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. Daniel Excel Worksheet Functions 0 June 23rd 05 11:56 PM
bypass password when update linking of password protected file Yan Excel Discussion (Misc queries) 1 February 7th 05 11:29 PM


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