Skip to main content
WolfShade
Legend
February 14, 2018
Question

Check for macros

  • February 14, 2018
  • 1 reply
  • 708 views

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,

^ _ ^

This topic has been closed for replies.

1 reply

WolfShade
WolfShadeAuthor
Legend
February 15, 2018

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,

^ _ ^

Inspiring
February 15, 2018

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

WolfShade
WolfShadeAuthor
Legend
February 15, 2018

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,

^ _ ^