Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/05/2005, 13:03
Avatar de xcars
xcars
 
Fecha de Ingreso: mayo-2005
Ubicación: El Salvador
Mensajes: 753
Antigüedad: 19 años
Puntos: 4
proba con esta funcion para verificar si existe o no un archivo fisico en las unidades de disco, luego, si no existe, create uno vacio para evitar el error

Código:
Public Function FileExist(ByVal sFile As String) As Boolean
    'comprobar si existe este fichero
    Dim WFD As WIN32_FIND_DATA
    Dim hFindFile As Long

    hFindFile = FindFirstFile(sFile, WFD)
    'Si no se ha encontrado
    If hFindFile = INVALID_HANDLE_VALUE Then
        FileExist = False
    Else
        FileExist = True
        'Cerrar el handle de FindFirst
        hFindFile = FindClose(hFindFile)
    End If
primero das
Código:
if not FileExists("archivo.csv") then
    dim num 
    num=freefile
    Open "c:\archivo.csv" For Output As #num
    Print #num, "algo"
    Close
end if