Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo liebe VB Gemeinde, ich hoffe ihr könnt mir helfen :)

Als erste mal der Code:


Sub listLoadFiles(ofFolder As Scripting.Folder, DestinationRange As Range)


    ' ListSubFolders

    Dim subFolder As Scripting.Folder

    Dim File As Scripting.File

    Dim RelFileName As String



    For Each subFolder In ofFolder.SubFolders


        'cycle files in dir

        For Each File In subFolder.Files


            If InStr(File.Name, ".xml") = 0 Or InStr(File.Name, ".bak") <> 0 Then

                'Skip'

            Else

           [B] 'subFolder.path sieht wie folgt aus: D:\new folder\loadFiles\...

            'das Excel Dok befindet sich in D:\new folder

            'File.Name ist load_Configuration.xml


           RelFileName = CStr(Split(subFolder.path + Application.PathSeparator + File.Name, loadFiles, "", vbTextCompare))

           'Split Funktioniert nicht Fehler: Typmismatch

           'nach dem Split müsste der Inhalt der RelFileName Variable wie volgt aussehen:

           'loadFiles\...\load_Configuration.xml


            DestinationRange.Value = "blabla" + "blablub" + RelFileName[/B]

            ' relative one down

            Set DestinationRange = DestinationRange.Offset(1, 0)

            ' Loop through

            End If

        Next File


        listLoadFiles ofFolder:=subFolder, DestinationRange:=DestinationRange

    Next subFolder


    'Save as XML'

    Call SaveXML("", "load_Configuration" & currentPath & ".xml", False, 1)

End Sub

also mit dieser Sub gehe ich in alle Unterordner und suche nach ".xml" Dateien. Wie ihr im Code sehen könnt habe ich als Kommentare meine Aufgabe soweit beschrieben, ich muss also den Pfad, der in der subFolder Variable, die ein FileSystemObject is, steht für jede Datei die ich finde "Spliten" und kürzen. Beispiel: die datei befindet sich da: Pfad der Datei: D:\new Folder\loadFiles\...\lad_Config.xml und ich muss es jetz so ausplitten das am Ende nurnoch: loadFiles\...\load_Config.xml in der Variable RelFileName steht. Um den Split durchzuführen muss der Inhalt der subFolder Variable(FSO) in ein String kovertiert werden.

Ich hoffe ich konnte mein Problem relativ verständlich beschreiben.

RelFileName = CStr(Split(subFolder.path + Application.PathSeparator + File.Name, loadFiles, "", vbTextCompare))

Das kann auch nicht funktionieren.

Split-Funktion

Gibt ein nullbasiertes, eindimensionalesDatenfeld zurück, das eine festgelegte Anzahl an untergeordneten Zeichenfolgen enthält.

Syntax

Split(Ausdruck[, Trennzeichen[, Anzahl[, vergleichen]]])

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.