Vba properties file


















This is a good bit of code. What I am struggling with is to amend the code to carry on the search in all subfolders. Your email address will not be published. Save my name, email, and website in this browser for the next time I comment. Range "C3". Cells iCurRow, 3. Name 'Date Created Sheet1. Cells iCurRow, 4. Cells iCurRow, 5. Cells iCurRow, 6. DateLastModified 'Size Sheet1.

Cells iCurRow, 7. Cells iCurRow, 8. Please share this with your friends and share your feedback, views in below comment box. June7 Alex K. Also See Microsoft site: technet. For those directed here this is out of date a bit. There are now attributes you can use. For example, file version Update the for loop to see them all.

Further update: As of sometime this past summer all indices above 6 are invalid, returning only empty strings. You can get this with. Print title Debug. Todd Main Todd Main My question wasn't very clear. I am trying to capture file attributes from files on disk. This looks like it is reading the properties from the open document.

How would I get the properties from a file on disk? For outside the client i. Changed the tags as this has nothing to do with Excel. Items TextBox1. Laurel 5, 12 12 gold badges 27 27 silver badges 54 54 bronze badges. I was finally able to get this to work for my needs. ParseName "Myfilename. There are other answers that provide the OP's question, and they were posted some time ago.

When posting an answer, please make sure you add either a new solution, or a substantially better explanation, especially when answering older questions. Ok, I thought I was clear. The referenced MS library link mentioned above provides current examples on how to make this work. Please check my edit - so, we should delete our comments for clean up.

This is exactly the opposite of what happens in the case of read-only properties, which are described above. Before we move on to the next topic, let's take a quick look at 2 final clarifications regarding the syntax you should use when working with VBA object properties:. Most VBA objects have a particular property that is their default. Therefore, theoretically, you can omit certain parts of the code.

In other words, you can simply make reference to the VBA object, without including the property after it. This is the case even if the property you're making reference to is the default property. Finally, note that Excel Power Programming also explains that in the case of properties that return a value, you must place parentheses around the arguments. This is an exception to the rules that I explain in the sections above.

Now that you know how to refer to and work with Excel VBA object properties, you may wonder…. Fortunately, you won't need to work with most of them. Most likely, you'll end up working with a relatively small portion of the available VBA object properties again and again. Additionally, even though each VBA object has its own properties, some properties are common to several objects. The following are some of the examples of common VBA properties. However, since you're likely to from time to time need some help to find out the properties that are available for a particular VBA object, let's take a look at 3 ways in which you can get this information.

Perhaps more importantly, it shows you the properties, methods and events of each of those objects. Once the Visual Basic Editor is displaying the Object Browser, you can have the VBE display all the relevant information about a particular object by following these 2 easy steps:. Once you've selected the Excel library, the Object Browser displays all the Excel objects in the left side of the screen. Simply search for the one you want and click on it. Once you've clicked on a particular object, the Object Browser lists all the properties and methods available for that object on the right side of the screen.

Notice how the ColorIndex property which is used in both sample macros within this Excel tutorial appears on the right side. The easiest way to find information about a particular object using this tool is by following these 3 simple steps:.

This step is self-explanatory. Simply type the name of the object you wish to find more information about. Therefore, the VBA code looks as follows:. The F1 key is the keyboard shortcut to open the help system. You can find a comprehensive list of keyboard shortcuts in this blog post. If the Visual Basic Editor finds that there are several possible matches for the keyword you've selected, it asks you to select a topic. This is what happens in the case of Range.

If there's no ambiguity it's clear which word you want to get information about , or once you've selected a topic in the Context Help dialog as in the case above , you're led to the relevant page within the Microsoft Developer Network.

Probably the easiest way of getting an idea of the properties of a particular object is by getting help from the Visual Basic Editor. The VBE displays a list with all the items such as properties and methods that can be associated with a particular object once you've typed the dot. The following screenshot shows how the Visual Basic Editor displays a list of properties and methods immediately after I type the dot. In order to be able to take advantage of this setting, your Visual Basic Editor must have the Auto List Members setting option enabled.

I explain how to do this here. This helps you get an idea of what are the properties and methods in the example above, the VBE shows only properties that you have available in a particular situation. The concept of object properties is central to Visual Basic for Applications. Therefore, if you plan on working with VBA, you'll spend a great deal of time dealing with object properties. Despite being a relatively basic concept, the topic of properties can be quite overwhelming. As mentioned above, there are thousands of object properties available throughout Visual Basic for Applications.

The good news is that you don't have to know absolutely all VBA object properties by heart in order to be able to do great work with Visual Basic for Applications. As long as you have a good understanding of the following 2 basic topics, you have a good base to start moving forward :. Here are some of my most popular Excel Training Resources:. I've got to confess something to you: I cover the topic of VBA objects extensively in Power Spreadsheets, including here and here.

Object methods. To be more precise: In order to become great in VBA, you actually need to understand and master both properties and methods.

This Excel tutorial covers 1 of these topics: Object properties. More particularly, in this blog post you'll read about the following topics: Table of Contents.



0コメント

  • 1000 / 1000