Andybuck86
09-06-2010, 11:14 AM
Hi guys,
I really need your help please!
I have a spreadsheet that keeps crashing when I am trying to save. The spreadsheet is saved on a pc and can be accessed by other users on the network through a mapped shared folder.
I have a button on the sheet which runs the following code:
Option Explicit
Sub Save_Password()
Dim Open_Password As String
Dim New_File_Name As String
New_File_Name = Range("G2").Value & "\" & Range("G1").Value & ".xlsm"
Open_Password = InputBox("Please enter a password to stop others from editing your timesheet. YOU MUST REMEMBER THIS PASSWORD")
ActiveWorkbook.SaveAs New_File_Name, _
WriteResPassword:=Open_Password, _
Password:="heather"
' ActiveWorkbook.SaveAs New_File_Name, _ ' creates a new file with the name in G1
' Password:=Open_Password, _ ' this is the password the user enters
' WriteResPassword:="password" ' this is the master password
End Sub
When this is clicked the spreadsheet stops responding and eventually I will get a RUN TIME ERROR 1004 method saveas of object _workbook failed
But, when I go through the file save as option, using the exact same method as my VBA code it works flawlessly.
Also, to make this even more confusing....when I try it on the computer it’s stored on, it works flawlessly.
This only happens when I access it from another computer on the network and use the VBA option.
Any ideas??
I really need your help please!
I have a spreadsheet that keeps crashing when I am trying to save. The spreadsheet is saved on a pc and can be accessed by other users on the network through a mapped shared folder.
I have a button on the sheet which runs the following code:
Option Explicit
Sub Save_Password()
Dim Open_Password As String
Dim New_File_Name As String
New_File_Name = Range("G2").Value & "\" & Range("G1").Value & ".xlsm"
Open_Password = InputBox("Please enter a password to stop others from editing your timesheet. YOU MUST REMEMBER THIS PASSWORD")
ActiveWorkbook.SaveAs New_File_Name, _
WriteResPassword:=Open_Password, _
Password:="heather"
' ActiveWorkbook.SaveAs New_File_Name, _ ' creates a new file with the name in G1
' Password:=Open_Password, _ ' this is the password the user enters
' WriteResPassword:="password" ' this is the master password
End Sub
When this is clicked the spreadsheet stops responding and eventually I will get a RUN TIME ERROR 1004 method saveas of object _workbook failed
But, when I go through the file save as option, using the exact same method as my VBA code it works flawlessly.
Also, to make this even more confusing....when I try it on the computer it’s stored on, it works flawlessly.
This only happens when I access it from another computer on the network and use the VBA option.
Any ideas??