Macros - Saving over protected worksheet using a macro.

D

Dolores

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.
 
R

RyanH

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

Dolores

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top