filesystemobject

  1. J

    How do I ignore hidden files?

    Hi, I currently have the below code to pull a list from a file path every time the worksheet is activated. Sub worksheet_Activate() Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Dim i As Integer Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder =...
  2. M

    VBA Excel find a file (partial file name) in a set of folders (doesn't return a value and doesn't exit function)

    Good Morning/Afternoon/Evening, I'm normally ok with VBA in Excel but i'm really struggling to understand what I have done wrong here. My end goal is to search for a file (using only the first part of the file name) in a set of folders and then send back to the calling function the full file...
  3. S

    Fast file search for most recently modified file

    Greetings, I recently threw together a bit of code that parses text from the most recently modified file in a selected folder. However, the folder keeps track of job tickets at my work, and it can fill up fairly quickly. Right now, 889 .txt files are in the folder to be searched. I have...
  4. E

    Using Excel VBA to copy one file and save it under a different folder with a different name

    Guys, I want to automate a redundant task that I do every day as a part of my work. Let's say I have a file with a standard name in a Source location, then I have a destination location. I want to copy this one file and save it as let's say 10 files with different names from an excel...
  5. M

    VBA Memory Leak?

    Hi All, Im not sure if I can attach the whole file as an example but I have described my VBA setup below. Any VBA help to identify and correct my memory usage issues would be greatly appreciated! I have a SharePoint site that has hundreds of Excel files stored on it and I interact with them...
  6. B

    where did the files move to?

    I recently made an error, and have found it repeatable in several formats. It happens when renaming file(s) using Excel's hidden method "Name", or Scripting.FileSystemObject's MoveFile, to name a few. When you rename and specify only a destination filename without path, the file(s) simply...
  7. P

    FileSystemObject Error 53 File Not Found

    Hi All, First I would like to say I am blown away by the support and learning I have received since I joined thank you! Second I had this running until today I received the error Original code below this Structure That worked until a user loaded a File name 293 characters Long as they are...
  8. E

    How Can I Only Open Text (.txt) Files When Working With FSO? (FileSystemObject)

    Currently have a working script that uses FSO, but it also opens .xlsm files within my working directory. I would like to to only open .txt files. I found this code that should work, however I can't figure out how to apply it to my situation: Sub test() ' Loop thru all files in the folder...
  9. B

    Change Characterset (Codepage), Scripting.Filesystemobject

    Hi All I've found this code and it's working fine. The function get the last recent (newest) file from a specified folder with a search string. Everything is working fine, but: if a folder contains special character (German, ä, ö, or ü) I get an exception "folder not found" while setting > Set...
  10. V

    List all files in server or folder using Dir

    Hi Excel Experts, This is my first post and sorry if there are any mistakes or not conform to rules while asking question. I thank everyone for making this forum a general one as many people can view the questions and learn excel. I work in excel and I want to extend the discussions of the 2...
  11. trishcollins

    Looping through all folders and subfolders in a drive and listing files

    I need to be able to list all files in all folders and subfolders in a particular drive (I use this macro to populate three different tables depending on the drive, so thus the mytbl and myPath variables. I also have it set to use a named range to determine whether or not to include...
  12. C

    Subfolders collection of FilesystemObject has a count

    Subfolders collection of FilesystemObject has a count but you can't reference it? Subfolders.Count = 12 prefect Folder.Subfolders(11) not allowed - errors Error 5 Invalid procedure call or argument likewise Folder.subfolders.Item(X) Is the Count of any use other than to tell how many there are?
  13. J

    Get last folder from .subfolder return (folders collection)

    I'm trying to find a way to get the last subfolder in a folder object without out using a “For Each” Loop. It seems to me that if the Folders Collection is stored in the memory so that in can be accessed through iteration, than there has to be a way to simply call one without looping through. I...
  14. G

    Problems with FSO.MoveFolder / DeleteFolder. Can't delete

    I have a spreadsheet and some associated documents in a folder and I want to move them into another folder with a macro. I quickly found out I could not use FSO.MoveFolder on the folder containing the excel sheet running the macro (It should have been obvious!). So I opted to saveAs the excel...
  15. S

    FileSystemObject Intellisense

    How can I get the intellisense to show up when working with the FileSystemObject? I went to tools->References and checked the box to include "Microsoft Scripting Runtime". I only need to include it in the references correct? I created a FSO and then tried doing FSO. and no methods or...
  16. J

    Recursive search in nested folders/subfolders and then open file

    Hello, I have been searching for a solution to a problem for quite some times now, and I was hoping one of you have a great idea in this forum. I first like to appreciate any help and any reply to my problem. My problem is, I have an excel macro that does multiple thing for a report purpose...
  17. J

    Obtaining JPEG Dimensions (Height/Width) with a Macro

    Hi all, I have a macro, part of which lists all the files (all JPEGs) in a particular folder. I need to obtain the width/height of these pictures in pixels. My understanding is I can't do this with FileSystemObject, is there another way? Any suggestions gratefully received. Jerry
  18. D

    Check if a file exists in subfolders by looping through and matching an excel range partial

    Hello everyone This is my first post. I've spent all day trying to figure this one out. What I'm trying to do is check the existence of files in subdirectories by matching text in an excel range ("A:A"). The text within each cell in the excel range are partial filenames. So far, I've been using...
  19. L

    Seeking help from a VBScript guru

    Can someone post code for the following? <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> Seeking program (script) that would: · Open each Excel file (.xlsb) in a designated folder · Save each · Close each Note: Needs to work even as folder content change...
  20. T

    List files and properties without FSO

    Hi. I am trying to list files and their properties (need modified date and size) from a directory. I have tried using FileSystemObject, but retrieving the file name seems to take a lot of time (oddly the other properties are listed in a flash). It takes me several minutes to list just a couple...

Some videos you may like

This Week's Hot Topics

Top