Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/01/2010, 03:57
Avatar de pkj
pkj
 
Fecha de Ingreso: julio-2006
Ubicación: Órbita sincrónica
Mensajes: 899
Antigüedad: 17 años, 9 meses
Puntos: 29
Respuesta: Error 75 al abrir varios text files

Ya que tanto empeño tienes te he buscado la solucion y así tambien la tendré yo.

Código vb:
Ver original
  1. Dim sFile() As String
  2.  
  3.   With CD1
  4.     .InitDir = "C:\Windows"                         '
  5.    .FileName = vbNullString                        'Clear out previous filename(s)
  6.    .Filter = "All Files (*.*)|*.*" 'Set the input mask
  7.    .FilterIndex = 1                                'Set index of filter
  8.    'Must have explorer flag with multiselect flag!!!
  9.    .Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNAllowMultiselect Or cdlOFNExplorer
  10.     .DialogTitle = "Import Files"                  'Set caption of CD
  11.    .CancelError = True                             'Die if there are any errors
  12.    .MaxFileSize = 30000                            'Just to make sure we have enough room
  13.    On Error Resume Next
  14.     .ShowOpen                'Open
  15.    
  16.     Select Case Err.Number
  17.       Case cdlCancel
  18.         'Cancel was selected
  19.        Exit Sub
  20.       Case Is <> 0
  21.         'Some other error occurred
  22.        Exit Sub
  23.       Case 0
  24.         'No error occured
  25.         sFile = Split(.FileName, ChrW$(0))              'Take apart null delimited list returned from multiselect CD
  26.     End Select
  27.      On Error GoTo 0
  28.   End With
  29.  
  30.   If UBound(sFile) > 0 Then
  31.     Dim f As Integer
  32.     For f = 1 To UBound(sFile)
  33.       MsgBox sFile(0) & sFile(f)
  34.     Next f
  35.   Else
  36.     MsgBox sFile(0)
  37.   End If

No sé donde tuve yo el problema, ya que parece facil, pero el caso es que me cansé y lo dejé.

Saludos
__________________
No hay preguntas tontas, solo gente estup..., ¡No!, ¿como era? No hay gente que pregunte a tontos... ¡Nooo!... ¡Vaya cabeza!

Última edición por pkj; 22/01/2010 a las 04:04