convert xls to xlsm using excelcnv.exe
I created a console application using the Microsoft Office utilities: ppcnvcom.exe
, excelcnv.exe
, wordconv.exe
to convert doc
to docx
, xls
to xlsx
and ppt
to pptx
respectively.
Does anyone know how to convert xls
to xlsm
?
OFC.exe
is one option, but when I called it from sharepoint it was not successfully converted. The converter is blocked due to some security issue. OFC.exe
automatically detects if 开发者_如何学Cthere is a macro in the xls
macro and then converts it to the xlsm
file.
Is there a way to do this using excelcnv.exe
?
Unfortunately, no, you can't do this with excelcnv.exe as it requires a file name. It would be wonky to name all your .xls files as .xlsm and then go through 1 by 1 to figure out which ones don't have macros.
Based on your comments, you've tried using OFC.exe, which is a much better way of going about this for what you're looking for. We should focus efforts on that instead. What exactly is the error you are receiving and how are you configuring your .INI file? (see http://blogs.msdn.com/b/ericwhite/archive/2008/09/19/bulk-convert-doc-to-docx.aspx for an example).
You have to use the Process class to run OFC.exe and then pass in the right command line arguments to point to your INI file.
EDIT: 2011-03-11: I guess if no more details are forthcoming to help troubleshoot this, I'll stick by the answer in the first paragraph as answering the OP's question: ...you can't do this with excelcnv.exe as it requires a file name.
You could try: http://sourceforge.net/projects/b2xtranslator/ instead
精彩评论