10-20-2008 07:53 AM
10-20-2008 08:13 AM
Hello kade!
Have a look in help for the 'DataFileLstGet' command. The command will find all 'sub' (binary) files to ONE 'master' file (TDM/TDMS) and doesn't work like a DOS 'dir'!!!
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
10-20-2008 08:28 AM
try this Code instead:
Option Explicit Dim s Dim oFSO Dim oFolder Dim oFiles Dim oFile Dim Ret Dim ExcelFilename Dim TDMSFilename Ret = PathNameGet("TDMSFiles Location", "D:\MFT\datamine\pmm\testresults\") Call DataDelAll(1) Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder(OutPutPath) For Each oFile in oFolder.Files ' Do-It-Yourself Extension Filter If UCase(NameSplit(oFile.name, "E")) = "TDMS" Then TDMSFilename = OutPutPath & oFile.name Call DataFileLoadSel(TDMSFilename,"TDMS","*/*","Load") ExcelFilename = OutPutPath & FileName & ".xls" Call ExcelExport(ExcelFilename,"", 0, OutPutPath & "EXCEL.STP") Call DataDelAll(1) End If Next
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
10-20-2008 08:56 AM
Thanks Matthias.
Still got a few issues:
1. It still only finds one TDMS file, eventhough I have 2 in my testresults directory.
2. The excel file is not being created correctly, it tells me the file is corrupt, this seems to also happen with my version of the script which leads me to beleive my excel maybe acting funny.
10-20-2008 09:06 AM
Hello kade!
I tried with a directory with 4 files. All were found! You can add a MsgBox before the extension filter to see a complete file list.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
10-20-2008 01:00 PM
Ok looks like the export is working now, but the file being created is not a good excel file. I get the error "file format is not valid"
any ideas ?
Kunle.
10-21-2008 01:41 AM
Hello Kunle!
I wrote my own DIAdem Excel export functions years ago so I'm not familiar with the funny build in functions. I recommend to start a new thread with this issue.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
10-21-2008 08:02 AM
i narrowed it down to a diadem general error, which is not obvious what the problem is. EXCELStat retruns "100". any ideas ?
10-21-2008 08:14 AM
Hello Kunle!
Error 100 is always beloved in DIAdem and absolut expressionless ! Or do you expect errors?
One possible reason for you problem could be that you already have opened the output file in Excel. Excel always opens files in exclusive mode.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |