Link to home
Start Free TrialLog in
Avatar of Lawrence Salvucci
Lawrence SalvucciFlag for United States of America

asked on

Get data from closed workbook that is password protected

I need to get some data from this range in my closed workbook that is password protected:

M22:O29

How can I retrieve this data and paste special (values) into my active workbook into range A2:C9?
Avatar of ScriptAddict
ScriptAddict
Flag of United States of America image

try

Workbooks.Open Filename:="Full Path Name", Password:="Apassword",  _ WriteResPassword:="Apassword"
Avatar of Lawrence Salvucci

ASKER

I also need to copy and paste special a specific range from this closed workbook and paste the values into my active worksheet.
ASKER CERTIFIED SOLUTION
Avatar of andrewssd3
andrewssd3
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Note that this does not use copy/paste - in VBA it's nearly always better just to assign the values from one range to another.  Copy/paste can be useful if you need to take formats as well, but generally is an unnecessary overhead.
Thanks Andrew! Much appreciated!