VBA-Code zum Ändern der Dateierweiterung

VBA-Code zum Ändern der Dateierweiterung
Inhaltsverzeichnis

Dateierweiterung mit VBA-Code ändern (mit Bildern)

Was ist es:

This VBA code will help you change file extension of the files in a particular folder/directory.

For eg. If you want to change the extension of the Excel files received in .xlsx to .xls or visaversa then this VBA code can be used.

Warum:

If you are working on project where you get input files with different file extensions where in you want the files in a standard format for your VBA program to work and you don’t have any control over the input files then this peace of code will be very helpful as you can change extension to any format you want.

Windows Script object is used to change the extension in this code.

How to Change File Extension using VBA code:





Step 1: Open the workbook that need to be protected and press Alt + F11

Schritt 2: Kopieren Sie den folgenden Code, fügen Sie ihn in das VBA-Editorfenster ein und speichern Sie die Arbeitsmappe.

				
					Sub changeExt()

strDir = "C:\myFolder\" 'mention your files folder path here

With CreateObject("wscript.shell")

   .currentdirectory = strDir

   .Run "%comspec% /c ren *.xlsx *.xls", 0, True

End With

End Sub
				
			

 

Step 3: Click F5 to run the code.

Change File Extension


Picture of Anson Antony
Anson Antonius
Anson ist ein beitragender Autor und Gründer von www.askeygeek.comEr verfügt über ein Jahrzehnt vielseitiger Erfahrung in den Bereichen Business Process Outsourcing, Finanz- und Rechnungswesen, Informationstechnologie, Operational Excellence und Business Intelligence. Während seiner Amtszeit hatte er für Unternehmen wie Genpact, Hewlett Packard, M*Modal und Capgemini in verschiedenen Rollen und Verantwortlichkeiten gearbeitet, angefangen vom Associate bis zum Manager. Etwas Neues zu lernen war schon immer seine Leidenschaft, asKeygeek.com ist das Ergebnis seiner Leidenschaft für Technologie und Business. Außerhalb von Geschäft und Technologie ist Anson ein Filmfan, der Stunden damit verbringt, Kino zu sehen und zu lernen, und auch ein Filmemacher!

2 Responses

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Glückwunsch!
Du hast es geschafft,
Nicht schließen!

UberCreate Creator Pro-Zugriff
kostenlos!!!

Dieses Popup wird nicht angezeigt wie du willst wieder!!!

Share to...