Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a model that uses VBA to save the file. The variables are
dimmed as appropriate and then I use this code to compile the save filename: DSNDirectory = "\\" & Range("appserver") & "\" & Range("appprogdir") & "\utils\" DSNFilename = Range("dsnfile") Then I use Application.DisplayAlerts = False ChDir DSNDirectory ActiveWorkbook.SaveAs FileName:=DSNDirectory + DSNFilename, _ FileFormat:=xlTextMSDOS, CreateBackup:=False DisplayAlerts = True and this saves the particular worksheet as a text file. And this all works until I lock the project for viewing and protect it with a password. Once that's done running the macro that contains the code described above results in an error 1004 method 'SaveAs' of object '_workbook' failed. I can't debug it because it's locked, and if I unlock it the code works. So I can't work out what's wrong! Does anyone have any ideas? Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting Code in Visual Basic Editor (Excel 2003) | Excel Worksheet Functions | |||
Protecting VB Code | Excel Programming | |||
Protecting the code | Excel Programming | |||
Protecting buttons with VB code rather than protecting sheets/books? | Excel Programming | |||
Hiding/Protecting vb code in excel | Excel Programming |