Link to home
Start Free TrialLog in
Avatar of gdunn59
gdunn59

asked on

MS Access VBA Code to Disable Protected Mode in a PDF and Excel Files

How can I use Access VBA Code to "Disable Protected Mode" in a PDF and Excel Files (ie via Registry, etc.)?

Thanks,
gdunn59
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

what do you mean by: "Disable Protected Mode" ?

If unprotected ?
gowflow
Avatar of gdunn59
gdunn59

ASKER

gowflow:

In some of the documents (Adobe or Excel) when first opened, it shows at the top right of the document the following (see attached).
C--Users-msc551-Desktop-EnableAllFe.docx
Avatar of gdunn59

ASKER

It's the Protected View.
I cannot see it in the file you attached. Your problem is what exactly ? You come across files that you try to open and you get: Protected Mode ? is that the issue ?

If yes then:
1) Are these files on your own PC and you want to get rid of this ?
2) Are these files newly imported from the net and you get this ?
3) Other please clarify.

My comment:
If 1) then if Manually:
To open all your documents in full editing mode in Word 2013 or Word 2010, just follow these simple steps.

1.Click the File tab in the upper left corner.
2.Select Options.
3.Select Trust Center in the left pane.
4.Click Trust Center Settings.
5.Select Protected View.
6.Uncheck all three options under Protected View and Click Ok.

if 1) thru VBA, Are you looking to specifically create a VBA routine that will do the content of 1) above ??
2) For your security should always be Protected Mode.
3) Will wait your clarifications.

Please advise.
gowflow
Avatar of gdunn59

ASKER

gowflow,

Our company has set it up so if we go to the Trust Center and Select Protected View, the options are dimmed out so we can't change them.

I thought there was a way with VBA Code that the registry could be edited to change that and then set the registry back to the original state.

Thanks,
gdunn59
Well if it is like this then it is thru Global Policy that is populated from your server and controlled by your IT staff. Usually it is closed. But have a question for you in your work environment are you able to (if you ask IT or superior or ... ???) are you able to have the Unprotected Mode ? like are they flexible about it or it is a strictly 'no go' ??

If it is a 'no go' then you are asking to 'infringe' or 'by pass' company rules ? Is that it ?

I am trying to understand here.

Then an other question: What does 'Protected Mode' prevent you of doing mainly and you need to have it off ?? Just to understand what is that you cannot do and whish to be able to do.

gowflow
Avatar of gdunn59

ASKER

My Manager said he would have to go all the way to the top to get it approved, and he really didn't want to.  I was just trying to see if there was a way via VBA Code to temporarily change it in the registry and then return it back to the original status in the registry after the process in the Access Database is completed.  If this is something that can be done, then I would present this to my Manager and he could see if upper management would at least approve that.  So then, I wouldn't "infringe" or "by pass" the company rules.  That was not my intentions at all.  I just wanted to see if this was a possibility, so we could present that for possible consideration of approval.

The reason why it has to be unprotected, is the VBA Code goes through the PDF and scrapes data from certain fields and puts in a table in the Access Database.

So currently, the user has to open each PDF they receive daily via email click on the "Enable All Features" button and then resave the PDF, then they are able to run the Access database to scrap the data.  So there is a way to do it, it just takes longer.  The user was able to do this for a long time, and then the company decided to change their policy on secured PDFs.  Like I said the user can still do what they need to do, it's just annoying to have to open each PDF first to enable the features, and then resave, then run the Access process.

Thanks,
gdunn59
ok so that is what I wanted to hear, still with this security the user can"


Like I said the user can still do what they need to do, it's just annoying to have to open each PDF first to enable the features, and then resave, then run the Access process.

Now where are we talking ? In Access you need this or Excel ? or PDF ? I am a bit lost here !!!
If Access or Excel do you have any existing code or not at all ?
gowflow
Avatar of gdunn59

ASKER

gowflow,

The scraping of the database is done via VBA Code in Access.  The database that is scraped is from a PDF file.  So the "Enable All Features" is in the PDF when it is opened, which keeps the VBA Code in Access from scraping the data.

Thanks,
gdunn59
ASKER CERTIFIED SOLUTION
Avatar of Jacques Geday
Jacques Geday
Flag of Canada 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
Avatar of gdunn59

ASKER

gowflow,

Ok.  I guess at this point it sounds like the task at hand is impossible.

Unless someone else has any suggestions.

Thanks!
Are you able to post the code that call the pdf ? So we could make more testing ?
gowflow
This question has been inactive for over 14 Days kindly proceed to close it best possible or else it will be closed by participants.
Regards

gowflow