ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros - Saving over protected worksheet using a macro. (https://www.excelbanter.com/excel-programming/417807-macros-saving-over-protected-worksheet-using-macro.html)

dolores

Macros - Saving over protected worksheet using a macro.
 
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.

RyanH

Macros - Saving over protected worksheet using a macro.
 
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.


dolores

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.



All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com