Highlighted

Check for macros

LEGEND ,
Feb 14, 2018

Copy link to clipboard

Copied

Hello, all,

I have worked extensively with the spreadsheet functionality in CF, and have to admit.. I love it.

However, I am curious about one thing.  Does CF natively have a way to check a .xls(x) file for macros?

Considering the environment that I work in, we do not allow macros in Excel spreadsheets on our network.  No exceptions.

But the PTB (powers that be) here are considering setting up a web app that has a section that will allow authenticated users to upload .xlsx files.  So, I am trying to find a way in which to scan the file for macros before processing, and deny the file if it contains any macros.

Is anyone aware of a way to do this?

V/r,

^ _ ^

Views

273

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Check for macros

LEGEND ,
Feb 14, 2018

Copy link to clipboard

Copied

Hello, all,

I have worked extensively with the spreadsheet functionality in CF, and have to admit.. I love it.

However, I am curious about one thing.  Does CF natively have a way to check a .xls(x) file for macros?

Considering the environment that I work in, we do not allow macros in Excel spreadsheets on our network.  No exceptions.

But the PTB (powers that be) here are considering setting up a web app that has a section that will allow authenticated users to upload .xlsx files.  So, I am trying to find a way in which to scan the file for macros before processing, and deny the file if it contains any macros.

Is anyone aware of a way to do this?

V/r,

^ _ ^

Views

274

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 14, 2018 0
LEGEND ,
Feb 15, 2018

Copy link to clipboard

Copied

Okay, so.... I've been looking around and ran across this page (Apache POI > VBAMacroreader) and was wondering if:

A) ColdFusion has access to this, and

B) will it do what I think it does?

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 15, 2018 0
Engaged ,
Feb 15, 2018

Copy link to clipboard

Copied

ColdFusion does not have this capability AFAIK or could find.  You can always add POI to your classpath and use the VBAMacroreader.  If you would open the file and use readMacros, I imagine you could figure it out.  Usually we would protect staff by disabling macros in Excel itself.

-Nic

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 15, 2018 0
LEGEND ,
Feb 15, 2018

Copy link to clipboard

Copied

Not sure if our environment disables macros in Excel, itself.  I'm just trying to add a layer of protection.

I know that CF already has access to POI, that's what SpreadsheetNew() and other spreadsheet functions use (so I understand.)  I just wondered if I could create a Java object from POI and access VBAMacroreader.

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 15, 2018 0
Engaged ,
Feb 15, 2018

Copy link to clipboard

Copied

You can try to use the baked in version, but in the past I had to download my own copy of POI and instaintate the Java object.

-Nic

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 15, 2018 0
LEGEND ,
Feb 15, 2018

Copy link to clipboard

Copied

(shrug)  I'll give the "baked in" version a shot.  How do I do that?

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 15, 2018 0
LEGEND ,
Feb 16, 2018

Copy link to clipboard

Copied

While I am still curious as to how to use the baked-in version, and would love to know about that, this has become a non-issue.

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 16, 2018 0