Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default HELP! Get error while saving after password protection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default HELP! Get error while saving after password protection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default HELP! Get error while saving after password protection

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protection in macro ( Anybody can view my password in VB Sherees Excel Discussion (Misc queries) 2 January 24th 10 10:05 PM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Error: Sharing Workbook w/password protection Jeff Wollschlager Excel Discussion (Misc queries) 0 May 13th 09 04:29 PM
Error when save as CSV with VBA password protection on [email protected] Excel Discussion (Misc queries) 0 August 1st 06 10:50 PM
Error Trap for bypassing Password Protection Arawn Excel Programming 0 June 4th 04 11:21 PM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"