What do I need:
When They want to do an Import, this is called:
But now I want to check first if the csv file exists ==>> Try:
Or is this the way to go:
Thanks in advance,
regards,
Combo
When They want to do an Import, this is called:
Code:
DeleteDataRecordMemory hmiFlashMemory, hmiOff, hmiOn, SmartTags("PERS_REC_MEMORY_CLEAR")
If Err.Number <> 0 Then
ShowSystemAlarm "Error #" & Err.Number & " " & Err.Description
Err.Clear
Exit Sub
End If
ImportDataRecords "\\pcg4\Shared\recs_PERSPROGRAMMA.csv", 0, hmiOverwriteAlways, hmiOn, SmartTags("IMPORT_PERS_STATUS")
If Err.Number <> 0 Then
ShowSystemAlarm "Error #" & Err.Number & " " & Err.Description
Err.Clear
Exit Sub
End If
But now I want to check first if the csv file exists ==>> Try:
Code:
Dim f, fs, filename
Set f= CreateObject("filectl.file")
Set fs = CreateObject("filectl.filesystem")
filename="\\pcg4\Shared\recs_PERSPROGRAMMA.csv"
If fs.dir(filename) = "\\pcg4\Shared\recs_PERSPROGRAMMA.csv" Then
'IMPORT POSSIBLE
End If
Or is this the way to go:
Should this work or should it be written in an other way ?filename="\\pcg4\Shared\recs_PERSPROGRAMMA.csv"
If fs.dir(filename) = "" Then
'end
Else
'import
End If
Thanks in advance,
regards,
Combo
Last edited: