Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to bypass password when pasting FROM a protected workbook

I can use code to open a password-protected workbook, and copy data
from a worksheet.
However, when I try to paste the data into a unprotected workbook (and
unprotected worksheet),
Excel prompts for a password.

I am very sure this happens at the PASTE stage, because I traced the
issue line by line using the
STOP command to see where the application prompts for the password.

Question is, I have already opened thw workbook by supplyhing the pwd
in the VBA code.
Why does Excel prompts for password before I paste to a UNPROTECTED
worksheet?

How do I avoid this in vba code?

Thanks in advance for your kind help.

Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default How to bypass password when pasting FROM a protected workbook

Unprotecting a workbook does not unprotect the sheets in the workbook.
Each sheet must be individually unprotected.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Lottery Numbers.xls... Excel picks numbers for 14 state/national (USA) lotteries - free)





"Larry"
wrote in message
...
I can use code to open a password-protected workbook, and copy data
from a worksheet.
However, when I try to paste the data into a unprotected workbook (and
unprotected worksheet),
Excel prompts for a password.

I am very sure this happens at the PASTE stage, because I traced the
issue line by line using the
STOP command to see where the application prompts for the password.

Question is, I have already opened thw workbook by supplyhing the pwd
in the VBA code.
Why does Excel prompts for password before I paste to a UNPROTECTED
worksheet?

How do I avoid this in vba code?

Thanks in advance for your kind help.

Larry



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default How to bypass password when pasting FROM a protected workbook

Larry presented the following explanation :
I can use code to open a password-protected workbook, and copy data
from a worksheet.
However, when I try to paste the data into a unprotected workbook (and
unprotected worksheet),
Excel prompts for a password.

I am very sure this happens at the PASTE stage, because I traced the
issue line by line using the
STOP command to see where the application prompts for the password.

Question is, I have already opened thw workbook by supplyhing the pwd
in the VBA code.
Why does Excel prompts for password before I paste to a UNPROTECTED
worksheet?

How do I avoid this in vba code?

Thanks in advance for your kind help.

Larry


The 'Open' password only allows you to open the file. It has nothing to
do with protection.

As Jim states, workbook protection is separate from worksheet
protection. You must re-apply protection (specifying the
'UserInterfaceOnly:=True' parameter) after a workbook is opened if you
want code to work on protected sheets. The UserInterfaceOnly parameter
does not persist after the workbook is closed, making it a 'runtime
only' option we have to reset every time.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to bypass password when pasting FROM a protected workbook

Thanks, Jim and Gary,

I'll check whether the worksheet is protected as well.

Cheers,
Larry




On Jan 16, 3:29*am, GS wrote:
Larry presented the following explanation :









I can use code to open a password-protected workbook, and copy data
from a worksheet.
However, when I try to paste the data into a unprotected workbook (and
unprotected worksheet),
Excel prompts for a password.


I am very sure this happens at the PASTE stage, because I traced the
issue line by line using the
STOP command to see where the application prompts for the password.


Question is, I have already opened thw workbook by supplyhing the pwd
in the VBA code.
Why does Excel prompts for password before I paste to a UNPROTECTED
worksheet?


How do I avoid this in vba code?


Thanks in advance for your kind help.


Larry


The 'Open' password only allows you to open the file. It has nothing to
do with protection.

As Jim states, workbook protection is separate from worksheet
protection. You must re-apply protection (specifying the
'UserInterfaceOnly:=True' parameter) after a workbook is opened if you
want code to work on protected sheets. The UserInterfaceOnly parameter
does not persist after the workbook is closed, making it a 'runtime
only' option we have to reset every time.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
link two cell from two workbook bypass password abbas_m19 Excel Discussion (Misc queries) 0 November 21st 07 07:05 AM
How To Get Into a Password Protected Workbook Donald Excel Programming 2 August 29th 06 07:18 PM
Multiple workbook user's with Master workbook - all password protected Yvon Excel Discussion (Misc queries) 2 March 30th 05 01:34 PM
bypass password when update linking of password protected file Yan Excel Discussion (Misc queries) 1 February 7th 05 11:29 PM
Open a password protected excel workbook from second workbook to fetch data using dynamic connection kaustav choudhury Excel Programming 2 April 3rd 04 06:18 AM


All times are GMT +1. The time now is 09:29 PM.

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

About Us

"It's about Microsoft Excel"