Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If my excel vba code is password protected I will get erros at this line of
code when trying to do a "save as" : ActiveWorkbook.SaveAs FileName:=CSPath & ActSheet & CSdata(loop1).csname, FileFormat:=xlTextWindows, Password:= "mypassword", CreateBackup:=False. How do I change the code so it can do a save on any excel workbook that happens to have password protection on the vba project? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It worked fine for me with the project protected (assume the file being
saved isn't the file with the code). Not sure what password protecting a text file does - for me, it did nothing. -- Regards, Tom Ogilvy "monica" wrote in message ... If my excel vba code is password protected I will get erros at this line of code when trying to do a "save as" : ActiveWorkbook.SaveAs FileName:=CSPath & ActSheet & CSdata(loop1).csname, FileFormat:=xlTextWindows, Password:= "mypassword", CreateBackup:=False. How do I change the code so it can do a save on any excel workbook that happens to have password protection on the vba project? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To clarify my situation, the code I posted above is in a VB program, and is
accessing an excel file, which has vba macros in it. Before I ever password protected my Excel vba projects, the following line of code worked perfectly: ActiveWorkbook.SaveAs FileName:=CSPath & ActSheet & CSdata(loop1).csname, FileFormat:=xlTextWindows, CreateBackup:=False. It seems that an OUTSIDE vb program that tries to do a "save as" on any protected vba code has problems. NOTE: The workbook and cells are NOT protected, only the vba project portion, which makes this even more odd. "Tom Ogilvy" wrote: It worked fine for me with the project protected (assume the file being saved isn't the file with the code). Not sure what password protecting a text file does - for me, it did nothing. -- Regards, Tom Ogilvy "monica" wrote in message ... If my excel vba code is password protected I will get erros at this line of code when trying to do a "save as" : ActiveWorkbook.SaveAs FileName:=CSPath & ActSheet & CSdata(loop1).csname, FileFormat:=xlTextWindows, Password:= "mypassword", CreateBackup:=False. How do I change the code so it can do a save on any excel workbook that happens to have password protection on the vba project? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password protection in macro ( Anybody can view my password in VB | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
Error: Sharing Workbook w/password protection | Excel Discussion (Misc queries) | |||
Error when save as CSV with VBA password protection on | Excel Discussion (Misc queries) | |||
Error Trap for bypassing Password Protection | Excel Programming |