Home > Software engineering >  How to use the program to convert XLS file to XLSM file?
How to use the program to convert XLS file to XLSM file?

Time:10-11

As title, I think XLS suffix excel file into XLSM suffix (excel2007/2010) files, please know the answer, it is best to use a Java implementation

CodePudding user response:

.
In the Java implementation to vb version to ask

CodePudding user response:

I mean can best use Java implementation, namely the VB/VBA is also ok

CodePudding user response:

 Set xlapp=CreateObject (" excel. Application ") Set xlbook=xlapp. Workbooks. Open (App) Path & amp; "\ JCD. XLS") 
Xlapp. Visible=False
Xlapp. DisplayAlerts=False
Xlbook. Saveas App. Path & amp; "\ JCD. XLSM", fileformat:=52
Xlbook. Close (False)
Xlapp. Quit

CodePudding user response:

The
reference 3 floor zoujing1000 response:
VB code
The Set xlapp=CreateObject (" excel. Application ") Set xlbook=xlapp. Workbooks. Open (App) Path & amp; amp; "\ JCD. XLS")
Xlapp. Visible=False
Xlapp. DisplayAlerts=False
Xlbook. Saveas App. Path & amp; amp; "\...


Third floor: hello, I want to ask next there's no way to determine whether a excel macro, I wanted to send no macro.xls files into XLSM, thank you

CodePudding user response:

You directly convert XLSX format, there is no macro exist,
XLSM can save macros,
 
On Error GoTo errline:
XlApp. Run (" Macro1 ") 'Run the macro
The exit
Errline:
If Err. Number="1004" Then "If no macro is saved as a XLSX
Xlbook. Saveas App. Path & amp; "\ JCD. XLSX", fileformat:=51
Xlbook. Close (False)
XlApp. Quit
End the If

CodePudding user response:

I started to work with the same problem, can't write the code!!!!!!!!!!!!!!!!!!! God save me
  •  Tags:  
  • VBA
  • Related