Category Archives: File and Folders

No Thumbnail

VBA Delete File

In this article I will explain how you can delete files using VBA. – Basics: The code below will delete the file specified by the path associated to the variable strPath: Sub Example1() Dim ObjFso As Object Dim strPath As String ‘file path strPath = “D:StuffBusinessTempTempFile.xlsx” Set

No Thumbnail

VBA Save File Dialog, FileDialog(msoFileDialogSaveAs)

There may be times when you need to ask the user to select a location to save a file. This can be done using the save file dialog. Keep in mind that the save file dialogs doesn’t actually save anything. It only returns the full

No Thumbnail

VBA Append Data to Text File

In this article I will explain how you can append data to a text file. I am assuming readers are familiar with modifying text files. If you are not familiar with modifying text files I’d recommend taking a look at the this article first VBA, Modify

No Thumbnail

Excel VBA, Text File to Columns

In this article I will explain how you can read the values in a text file and print them in columns in Excel. For example lets say we have the following data in a text file: We want to read the data from the text

No Thumbnail

VBA, Check If Text File is Open

When you are working with text files, it is a good idea to check for errors when opening the file. Without the proper error handling the program might terminate unexpectedly. The file and code related to this article can be downloaded here. Below are a two reasons why the program

No Thumbnail

Excel VBA Open File Dialog

There may be times when you need to ask the user to select a file to open. This can be done using the open file dialog. Keep in mind that the open file dialogs doesn’t actually open anything. It returns the path of the file