Questions tagged [fso]

Object Model component on Windows systems that represents the local file system.

The FileSystemObject (FSO) Object Model is used to access the local file system. Among other things, it provides methods for

  • reading file properties
  • creating and deleting files and folders
  • reading from files

For a complete list, visit the documentation link below.

Questions using the tag are expected to relate to programming

Links:

118 questions
0
votes
0 answers

Copy and rename folder into another folder based on field value name

I have this code, my objective is to copy and paste a folder (with all its content) from a current template folder to paste onto a destination file path that is based on the field values as a condition to the new file destination name. I am…
0
votes
1 answer

VBA Macro : catch a line with specific string and return it

im trying to catch simulation results from a simulation report (.log).I want to match "passed" and "failed" strings and to save the line where the match were done in an other results file that i will use for further operations in excel. I couldn't…
ES87ME
  • 57
  • 1
  • 6
0
votes
1 answer

Create sub folders from cell value/s

Hi I am attempting to create sub folders using the value in a cell which is "Nikki jules\Fallen Kingdom\night watch" but every time i run the macro it says folder path not found 76. I even tried it Mkdir. folder1 = Range("G1").Value 'G1 value is…
Rj M
  • 33
  • 1
  • 4
0
votes
0 answers

Fast File Manipulation In VBScript?

Using VBScript on local Windows 10 machine to automate some tasks. Dealing with large binary files (500 MB up to 2 GB). FileSystemObject's file handling is abysmally slow! ADODB is fast, but loads the entire file into memory, a big no-no since I…
Makaveli84
  • 453
  • 6
  • 16
0
votes
1 answer

How to copy specific files from subfolders to a destination folder? (Excel VBA)

I am fairly new to VBA and any help with this program is greatly appreciated! The goal of this program is to copy all specific file types (.pdf) from the network to a folder on the desktop. However, the (.pdf) files are in each of the folders…
ducky
  • 1
  • 1
0
votes
3 answers

Unable to open file using fso

I'm trying to open a file using FileSystemObject, but when I'm trying to run it, the system does nothing. Doesn't show me Debug, No runtime error, doesn't compile. It just remains as it is. I have also checked the "MS Scripting Runtime" in…
JayyM
  • 155
  • 1
  • 3
  • 13
0
votes
1 answer

Opening Each File in a Loop

I'm writing a subroutine that needs to extract text from files in a directory. The routine is below. It works as long as there is only one file in the directory. When there are more than one, it tells me Set intFSO = intFSO.OpenTextFile(filePath, 1)…
Quintin
  • 21
  • 5
0
votes
0 answers

Deleting a File using VBA

I currently have a code to delete files in a userform. I enter a reference and this in term populates to a sheet and all the calculations are worked out. What I am trying to do is delete the old existing document and then save a new copy with the…
MBrann
  • 223
  • 5
  • 23
0
votes
2 answers

VBA/Excel - find path for saving a file, but only match a certain part of the path

I'd like to save a file in the following example folder: C:\MainFolder\Subfolder1\Subfolder2\Subfolder3_A_abc_123 There are other subfolders in the folder where I'd like the file be saved, like: Subfolder_B_xyz_456 Subfolder_C_rst_789 etc The thing…
pythonstyle
  • 23
  • 1
  • 5
0
votes
1 answer

Deleting a folder using VBA and it still appears in File Explorer until the next iteration

VBA - Access I'm using fso.DeleteFolder to delete a folder on a server that an earlier function in the same Access DB created. The fso.DeleteFolder code runs without error and running fso.FolderExists after shows the folder no longer exists (prior…
Scotty B
  • 3
  • 5
0
votes
0 answers

Fully qualified path for a folder

Using this code Dim fo As Scripting.Folder Set fo = fso.GetFolder(m_sFolder) Dim nSubfolder As Scripting.Folder For Each nSubfolder In fo.SubFolders Debug.Print "Folder " & fo.Path & " has subfolder " & nSubfolder Next ... I get the folder…
tmighty
  • 10,734
  • 21
  • 104
  • 218
0
votes
0 answers

HTML/JS: setting file property of file input

I've been looking into fso in JS, and was wondering if it was possible to get and play a video locally stored on the client machine, with just the path saved in a database? the following example would imply a local web application running on IIS (or…
Grey
  • 877
  • 9
  • 29
0
votes
0 answers

Save .XLSM as a .XLSX in VBA

I'm trying to save all .xlsm files in a folder path as .xlsx and although the script works successfully each workbook becomes corrupt. Could someone explain how i can overcome this issue Thank you in advance. Set fso =…
Paul
  • 53
  • 1
  • 8
0
votes
1 answer

Pull in a range of folders within the last week

The following code pulls in all folders within a particular folder path. Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("LOCATION") With Worksheets("Sheet1") i = 1 For Each objSubFolder In…
Paul
  • 53
  • 1
  • 8
0
votes
1 answer

Excel VBA + Generate List of full file names given file base names (or similiar)

I need to search the file system (a drive usually) for a fully defined file path while given only a fragment of the file name. The fragment is actually the part number of the part, and the files to search are all of type '.idw'. Further, they are…