snb
Verenigingslid
- Lid geworden
- 12 jun 2008
- Berichten
- 20.225
Code stopt bij Userform.show
Dan zit de fout in de Userform_initialize of Userform_activate procedure.
Plaats je bestand.
Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Code stopt bij Userform.show
Private Sub Userform_Initialize()
Listbox3.List = Split(createobject("wscript.shell").Exec("cmd /c Dir ""C:\Users\LucBr\Sk\BRU_HRS_Int_Team - DISPATCH HRS\LOGBOEKEN\Scan\*.pdf"" /b/on").stdout.readall, vbCrLf)
End Sub
Private Sub UserForm_Initialize()
Dim xp, it, i As Long, j As Long, tmp
ReDim a(0)
xp = "[COLOR=#3E3E3E]C:\Users\LucBr\Sk\BRU_HRS_Int_Team - DISPATCH HRS\LOGBOEKEN\Scan\[/COLOR]"
For Each it In CreateObject("scripting.filesystemobject").getfolder(xp).Files
If it.Name Like "*.pdf" Then
a(UBound(a)) = it.Name
ReDim Preserve a(UBound(a) + 1)
End If
Next
'For i = LBound(a) To UBound(a) - 1
' For j = i + 1 To UBound(a) - 1
' If a(i) > a(j) Then
' tmp = a(j)
' a(j) = a(i)
' a(i) = tmp
' End If
' Next j
'Next i
ListBox1.List = a
End Sub
Acces is denied. Fout tijdens uitvoering 2147024891 (80070005)
Private Sub UserForm_Initialize()
Dim xp, it, i As Long, j As Long, tmp
ReDim a(0)
xp = [COLOR=#333333]"[/COLOR][COLOR=#3E3E3E]C:\Users\LucBr\Sk\BRU_HRS_Int_Team - DISPATCH HRS\LOGBOEKEN\Scan\[/COLOR][COLOR=#333333]"[/COLOR]
With CreateObject("scripting.filesystemobject")
For Each it In .getfolder(xp).Files
If it.Type = "Adobe Acrobat-document" Then
a(UBound(a)) = it.Name
ReDim Preserve a(UBound(a) + 1)
End If
Next
For i = LBound(a) To UBound(a) - 1
For j = i + 1 To UBound(a) - 1
If .getfile(xp & a(i)).datecreated > .getfile(xp & a(j)).datecreated Then
tmp = a(j)
a(j) = a(i)
a(i) = tmp
End If
Next j
Next i
End With
ListBox1.List = a
End Sub
Private Sub Userform_initialize()
c00 = "G:\OF\"
c01 = Dir(c00 & "*.PDF")
With CreateObject("ADODB.recordset")
.Fields.Append "bestand", 129, 120
.Fields.Append "datum", 7
.Open
Do Until c01 = ""
.AddNew
.Fields("bestand") = c01
.Fields("datum") = FileDateTime(c00 & c01)
.Update
c01 = Dir
Loop
.Sort = "datum desc"
Listbox3.columns = .GetRows
End With
End Sub
Sub M_snb()
With Application.FileDialog(3)
.InitialView = 2
.InitialFileName = "G:\OF\*.pdf"
If .Show Then ActiveCell.Hyperlinks.Add ActiveCell, .SelectedItems(1), , .SelectedItems(1), .SelectedItems(1)
End With
End Sub
Private Sub UserForm_Initialize()
Dim xp, it, i As Long, j As Long, tmp
ReDim a(0)
xp = "C:\Users\LucBr\Sk\BRU_HRS_Int_Team - DISPATCH HRS\LOGBOEKEN\Scan\"
With CreateObject("scripting.filesystemobject")
For Each it In .getfolder(xp).Files
If it.Name Like "*.pdf" Then
a(UBound(a)) = it.Name
ReDim Preserve a(UBound(a) + 1)
End If
Next
For i = LBound(a) To UBound(a) - 1
For j = i + 1 To UBound(a) - 1
If .getfile(xp & a(i)).datecreated < .getfile(xp & a(j)).datecreated Then
tmp = a(j)
a(j) = a(i)
a(i) = tmp
End If
Next j
Next i
End With
ListBox1.List = a
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.