05-24-2017 03:55 AM
Hi,
I created an Excel file wich I use as a template for some data analysis reports. I'd like to use DIAdem to change values in this file and to save it, but without changing the original file design.
I already tried to save as a CSV, but of course the special fonts and colors I used are not supported. A TDM doesn't fit eather.
For information, I know I could do such things directly in DIAdem Reports, but the result wasn't completly what I expected, and I want to export Excel files to allow people without DIAdem to modify the values if necessary.
I join the Excel template I want to modify with DIAdem, to make it clear.
I hope I am clear and somebody has an idea to solve this question.
Thanks for help.
Solved! Go to Solution.
05-26-2017 04:31 AM
Hi,
If Excel is installed you can use its OLE interface to write new data to your file.
Here's a simple example:
dim oExcel,oWS 'get excel automation object and open workbook / -sheet set oExcel = CreateObject("Excel.Application") call oExcel.Workbooks.Open(CurrentScriptPath & "Report Template.xlsx") set oWS = oExcel.Worksheets(1) 'change your data here using line and column index for your cells oWS.Cells(3,3).Value = 11 'save file and close Excel call oExcel.ActiveWorkbook.Save() call oExcel.Quit() set oExcel = nothing
Also have a look at this DIAdem example: DIAdem Client Operation with Excel as Server
Regards