View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
dolores dolores is offline
external usenet poster
 
Posts: 12
Default Macros - Saving over protected worksheet using a macro.

Actually,
I used the macro record tool that comes with excel, I am better an modifying
macros than I am at creating them. So the only part of the code that was
written was the save as (see below).
Sub saveas()
'
' saveas Macro
' Macro recorded 9/30/2008 by dgomez
'
ChDir "F:\Illinois-Indy Sales"
ActiveWorkbook.saveas Filename:="F:\Illinois-Indy Sales\Bid
Register.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

when I run the macro I get the following error "Cannot access read-only
document "Bid Register.xls"

"RyanH" wrote:

Please post your code and specify where the error is, it helps to diagnos the
problem. Otherwise we are just guessing what you need.

--
Cheers,
Ryan


"Dolores" wrote:

I need to create a macro to save an excel file in a separate directory.
However I am not that familiar with creating macros (i'm much better at
making changes to an existing macro).

The problem that I am running into is that the file that is saved in the
other directory is a protected excel spreadsheet, so when I run my macro it
gives me an error.