Check if File or Folder Exists with Excel VBA (DIR function) - Open File or Create Folder

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024
  • Join 400,000+ professionals in our courses here 👉 link.xelplus.c...
    Use the DIR function in Excel VBA to check if a file or a folder exist. You can then decide what to do if they exist. For example you can open the Workbook to copy values from and then close the workbook.
    ⬇️ Download the workbook here: pages.xelplus....
    Here's what you can expect:
    Understanding the VBA DIR Function: Gain a clear understanding of the DIR function in VBA, which checks for the existence of files or folders.
    Practical Application: See how to apply the DIR function in real-world scenarios, like verifying file existence or folder presence.
    Using Wildcards in Paths: Discover how to use wildcards like asterisks (*) and question marks (?) in file paths for more flexible searches.
    Step-by-Step Examples: Follow along with two practical tasks. First, learn how to check if a specific file exists and open it if it does. Second, see how to verify if a folder exists and create it if it doesn't.
    User Interaction: Understand how to use message boxes to interact with the user, providing options based on the existence of files or folders.
    Creating and Using Variables: Learn how to declare and use variables effectively in VBA for path and folder names.
    I will also show you how you can handle cases where the file does not exist or the file name is not typed correctly. In that case VBA generates an error but you can easily avoid with the IF statement.
    I also show you how you can check with VBA if a folder exists. and if it doesn't exist, how you can create the folder. We use the message box function to ask the user for permission if we should create the folder or not.
    🌍 My Online Excel Courses ► www.xelplus.co...
    ★ Links to related videos: ★
    Learn about declaring variables in VBA: • How to Declare (Dim) a...
    Complete Excel VBA free course (playlist): • Excel VBA & Macros Tut...
    ➡️ Join this channel to get access to perks: / @leilagharani
    👕☕ Get the Official XelPlus MERCH: xelplus.creato...
    🎓 Not sure which of my Excel courses fits best for you? Take the quiz: www.xelplus.co...
    🎥 RESOURCES I recommend: www.xelplus.co...
    🚩Let’s connect on social:
    Instagram: / lgharani
    LinkedIn: / xelplus
    Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!
    #ExcelVBA

ความคิดเห็น • 120

  • @LeilaGharani
    @LeilaGharani  9 หลายเดือนก่อน

    Grab the file I used in the video from here 👉 pages.xelplus.com/vba-dir

  • @vinods1778
    @vinods1778 5 ปีที่แล้ว

    Leila Gharani
    i have become a Great Fan of you,the way you explain the concepts,tips and communication . ...Excellent

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      I'm glad to hear that my tutorials are helpful for you.

  • @1gopalakrishnarao
    @1gopalakrishnarao 6 ปีที่แล้ว +1

    Excellent. Taking lot of trouble to make the things very easy for Excel/VBA learners. Thanks a lot to my beloved/beautiful/brainy EXCEL TEACHER.

    • @1gopalakrishnarao
      @1gopalakrishnarao 6 ปีที่แล้ว

      Thank you Madam. I am learning many things from you. I pray the almighty to bestow good health & Prosperity to you, as you are doing a great & noble job for the benefit of Excel lovers/users.

  • @mariostudio7
    @mariostudio7 6 ปีที่แล้ว +11

    Your tutorials are TOP quality!! Thank you! 😊

  • @helenasvensson6595
    @helenasvensson6595 9 หลายเดือนก่อน

    Great tutorial! Thanks!

  • @mjabeer
    @mjabeer ปีที่แล้ว

    i needed it..
    Thank you

  • @augustodemelo915
    @augustodemelo915 3 ปีที่แล้ว

    It is just great!
    You are for sure the best!
    Your didactic is just perfect!

  • @narendrangananathar8107
    @narendrangananathar8107 3 ปีที่แล้ว

    Amazing Presentation! It was very helpful to me. Thank you Leila

  • @luisfelipegola5622
    @luisfelipegola5622 6 ปีที่แล้ว

    Hello Leila. Very well explained and useful in future projects using VBA. I am a fan of your channel. Thanks for sharing this content.

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      Thank you Luis! I'm glad you find the content useful :)

  • @bestscenes1469
    @bestscenes1469 2 ปีที่แล้ว

    Thanks so much. This video was exactly what I need for my project. You are a life saver

  • @VictorPerez-uy3pg
    @VictorPerez-uy3pg 3 ปีที่แล้ว

    Leila always coming through

  • @davidyenni3455
    @davidyenni3455 3 ปีที่แล้ว +1

    Hi Leila, Your videos' are very helpful. Thank you so much! :-) God bless, David

    • @LeilaGharani
      @LeilaGharani  3 ปีที่แล้ว

      You are so welcome, David!

  • @md.saifulislamtuku9303
    @md.saifulislamtuku9303 6 ปีที่แล้ว

    Thanks from Bangladesh

  • @SuperHanme
    @SuperHanme 2 ปีที่แล้ว

    Great, Thank You.

  • @MohAboAbdo
    @MohAboAbdo 2 ปีที่แล้ว

    Thank you so mutch.

  • @falakkhan4886
    @falakkhan4886 ปีที่แล้ว

    Hi Leila. I really like your videos and they're super easy to follow but I'm having problem in Vba and macros tutorial. Please elaborate more in your videos.

  • @ckokse
    @ckokse 6 ปีที่แล้ว +1

    Thanks for another VBA video!

  • @showtimehereiam
    @showtimehereiam 5 ปีที่แล้ว

    Thank you so much Leila.
    Once again you saved my life, it works like charm !
    Keep it up with the great work

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      I'm glad to hear that!

    • @msiddiqui4556
      @msiddiqui4556 4 ปีที่แล้ว

      @@LeilaGharani Hi, this video is for one perticular file in folder, how can we check if there are multiple .pdf files in particular folder. If .pdf file exist it should return the value true else false, Need your support leila, thanx

  • @boooooooster
    @boooooooster 7 หลายเดือนก่อน

    Any solution for URL path-and-filenames on OneDrive?

  • @ashisbasak1175
    @ashisbasak1175 6 ปีที่แล้ว

    Thanks Laila for this DIR function VBA

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว +1

      You're very welcome Ashis.

  • @nabilsn411
    @nabilsn411 6 ปีที่แล้ว

    I love your tutorials. Keep it up.. Thx

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      Thank you! Will keep going :) Appreciate your support.

  • @mukhaladalshimary4429
    @mukhaladalshimary4429 5 ปีที่แล้ว

    great explanation

  • @vida1719
    @vida1719 6 ปีที่แล้ว +1

    As always such a good logical explanation

  • @as_jugadi272
    @as_jugadi272 2 ปีที่แล้ว

    Thank you mam...

  • @huynhngoclinh4167
    @huynhngoclinh4167 3 ปีที่แล้ว

    Thank you so much Leila.
    Please help me
    How to delete the file that i did it in the folder two days ago

  • @MalinaC
    @MalinaC 6 ปีที่แล้ว +1

    Thank you Leila! :)

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว +1

      You're very welcome Malina :)

  • @rajumasih234
    @rajumasih234 3 ปีที่แล้ว

    Mam really your tutorial is to good
    Mam now my question is. I am using a network excel macro enable file but when I open it and start work and same time my partner also try to open that file .can teach me how I make a make macro to restrictions it reopen please mam

  • @peterjmaida2057
    @peterjmaida2057 6 ปีที่แล้ว +1

    Great video but one question. Why did you say that you were not smart in the other video when I told you that you are. Don't you have a Master's degree? I graduated from high school 30 years ago but barely. I struggled in school now I am 48. Are you kidding me? You are brilliant. Having said that about myself, now who isn't smart, you or me. Don't say you are not smart.

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว +3

      Thank you for the kind words. Yes - I have a master's degree - but honestly I don't think that makes me smart. I knew how to study and pass exams, but that doesn't mean I remember anything I learnt :) I think everyone is good at something. In my case, it might be explaining formulas or VBA code - in your case it might be something else - but then again, you're watching Excel videos in your free time! Not many people do that. The education system has a way of branding us with our grades and schools but the most important things I learnt in my life that impacted my career was actually outside the education system. So let's say, depending on the topic, we're all smart in our own ways...

  • @piyalfernando4914
    @piyalfernando4914 ปีที่แล้ว

    Hi Leila, can you help me telling if is there any method to take a print out of a PDF file by VBA

  • @anabylmychel5599
    @anabylmychel5599 หลายเดือนก่อน

    How do I check if the file exists if it is on a SharePoint URL?

  • @abhinavvivek2732
    @abhinavvivek2732 4 ปีที่แล้ว

    Hi,
    Thank you for this informative video.
    Request you to please share information on Microsoft ActiveX library...which version should we use, which version is capatible with different excel versions.
    Thank you
    Abhinav

  • @buykabuyka5006
    @buykabuyka5006 3 ปีที่แล้ว

    thank u

  • @pravinwaghchoure2277
    @pravinwaghchoure2277 4 ปีที่แล้ว

    Could you please upload sql database connection videos.. it will help us to learn more on database connections

  • @kcthedog6444
    @kcthedog6444 3 ปีที่แล้ว

    doesn't work on a Mac. any updates for browsing/selecting folder for modern Macs?

  • @hosseinhosseinpoor4845
    @hosseinhosseinpoor4845 3 ปีที่แล้ว

    thanks..

  • @ajaythatipalli2197
    @ajaythatipalli2197 5 ปีที่แล้ว

    Thanks for clear video, here I have a question, i.e., if folder already exists and user is willing to overwrite the current folder. Could u explain how to proceed plz.

  • @maihuire11
    @maihuire11 5 ปีที่แล้ว +1

    Excel is pretty :)

  • @anilulchala5532
    @anilulchala5532 4 ปีที่แล้ว

    Hello your video on DIR function is very helpful. Can you help me that can we open a folder and search with a word by VBA code

  • @emptymind9107
    @emptymind9107 5 ปีที่แล้ว

    Great tutorials thank you,
    Could u do tutorial on transfer specific files from one folder to another folder using vba...

  • @amoljadhav7392
    @amoljadhav7392 4 ปีที่แล้ว

    Hi Leila, rather than entering that full file path, can we auto return to the active workbook path? as directory path may vary
    please resolve. I'm trying to use Workbooks.Open "ActiveWorkbook.Path" & FileName or ThisWorkbook.Path instead of the file path. but doesn't work!

  • @ZAFAR4310
    @ZAFAR4310 ปีที่แล้ว

    I have created a flow to find onedrive files but what condition should I use if respone to email me that file does not exist.

  • @valdereiantunes
    @valdereiantunes 4 ปีที่แล้ว

    Dear Leila I would like to know how to create a new folder, using the same name, but add a number in front of this folder already created, this method is like windows does, New Folder, New Folder (2).
    Oh and thanks for you explanation about this method, it's help me a lot.

  • @jellyacecream
    @jellyacecream 3 ปีที่แล้ว

    For file path, is it possible to search in a sharepoint instead of local drive?

  • @aryanpramod
    @aryanpramod 5 ปีที่แล้ว

    Thanks a lot....

  • @kelvin55141
    @kelvin55141 4 ปีที่แล้ว

    Request : Hi Leila, please you create a video where show us how VBA code can convert excel to pdf and email it as attachment. thanks

  • @beelogtv9549
    @beelogtv9549 2 ปีที่แล้ว

    How to search multiple path?

  • @RJ-dz1hu
    @RJ-dz1hu 6 ปีที่แล้ว

    Thank you

  • @DavidFMayerPhD
    @DavidFMayerPhD 5 ปีที่แล้ว

    Leila Gharani, I have a question:
    Why is it that you use the A1 style of notation instead of the R1C1 notation? It is far more convenient, especially when using VBA, to refer to NUMERIC row and column. The following example from VBA code shows how much more convenient Row/Column reference is:
    SourceRow = ActiveCell.Row
    Tenure = Cells(SourceRow, 2).Text
    NameLast = Cells(SourceRow, 3).Text
    NameFirst = Cells(SourceRow, 4).Text
    ActiveWindow.ActivatePrevious
    Cells(DestinRow, 1).Value = Tenure
    Cells(DestinRow, 5).Value = NameFirst
    Cells(DestinRow, 7).Value = NameLast
    This is especially convenient when dealing with worksheets with more than 26 columns. Yes, I realize that this can also be done with A1 notation, but not as cleanly.

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      For me it depends on the task at hand. If I'm looping through columns I go R1C1 style, other times I generally prefer A1 style.

    • @DavidFMayerPhD
      @DavidFMayerPhD 5 ปีที่แล้ว

      @@LeilaGharani I use ONLY R1C1 style so that I don't make mistakes. I see ZERO value in the A1 style. I don't want to have to remember which letter of the alphabet Q is.

  • @nathaniel8422
    @nathaniel8422 2 ปีที่แล้ว

    I get Exit Sub not allowed in function or property, it breaks on Exit sub line.

  • @graywolfweb1361
    @graywolfweb1361 2 ปีที่แล้ว

    Would anyone know how to use this exact functionality with sharepoint files? If exists exit sub else save file end if, for example.

  • @2010pavi
    @2010pavi 4 ปีที่แล้ว

    can you tell me specific file open specific folder only please (if that file cope then past desktop or ex...will not open or destroy self)

  • @peterkristof9291
    @peterkristof9291 6 ปีที่แล้ว

    Hello Leila, Is it possible to take file name from cell? Lets say I got folder with 52 excel files named 1-52 each one represent a week in the year and I would like to use macro to always open file for current week.

  • @wayneedmondson1065
    @wayneedmondson1065 6 ปีที่แล้ว

    Hi Leila.. thanks for this video on DIR and examples of how to use it.. very helpful. I noticed that your code indents are 2 characters vs. the default of 4. Is that your normal preference or do you do that just for the sake of the video presentation? I have always used the default of 4 spaces, but I see lots of debate on the Internet about 2, 3 or 4 spaces. Any comments on what you recommend for students learning VBA today? Thanks again and Thumbs up!

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว +1

      Thank you for your comment Wayne. My indent on the Surface (where I film) is 4 characters, but you're right, it actually looks like 2. When I open the same file on my other computer, it looks much more indented. I've always stuck to 4. It's worked well for me :)

  • @xguyzerx
    @xguyzerx 4 ปีที่แล้ว

    how to you write? \\server\trackers$ - trackers folder? in vba how do you declare it?

  • @willdobler7763
    @willdobler7763 4 ปีที่แล้ว

    Hi I tried to use this to check a sharepoint directory to see if the file is located there. Its giving me a Run Time Error '52' Bad file name or number. Do you have any suggestions?
    I've been using your videos to catch up on a new job so any help would be appreciated

  • @ankurjain4267
    @ankurjain4267 4 ปีที่แล้ว

    Thank you so much for your tutorial videos, need your help to get a VBA code to copy and paste a data from specific folder in one Excel sheet and files names are as per worksheet tab name.

  • @sumanpaul1948
    @sumanpaul1948 4 ปีที่แล้ว

    Hi, I am facing trouble to check the existing file in a specific folder. Because I am creating the file name automatically with a specific cell reference. Could you please help to get the VBA code to check if the file exists? Here I am showing my file path: [[ActiveSheet.Range("A1:O102").ExportAsFixedFormat xlTypePDF, FileName:="C:\Levi's Recipe\" & ActiveSheet.Range("P1").Value, openafterpublish:=True]] Thanks in advance.

  • @ErJanardhanJethi
    @ErJanardhanJethi 5 ปีที่แล้ว

    Hi..
    I'm new to VBA, have a doubt and would like to clarify...how to check if a word file opened before opening in vba.

  • @WebTechies82
    @WebTechies82 5 ปีที่แล้ว

    Hi I also need very similar help as the previous one how to display Available & Not in available in the column if file exists in folder it should print in the column available if not it should print Not available in the column

  • @kuzev
    @kuzev 4 ปีที่แล้ว

    Does it work with files on a server or OneDrive?

  • @md.saifulislamtuku9303
    @md.saifulislamtuku9303 6 ปีที่แล้ว

    Thanks

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      You're very welcome Saiful. Thanks for watching :)

  • @desaitejas
    @desaitejas 5 ปีที่แล้ว

    Hello,
    Basis this tutorial, I created the folders. Now i have multiple files and I want to copy these files in different folders basis the excel where I have mentioned the folder name and next to it have mentioned the file names. Need a Macro which can read the folder name mentioned in excel column and copy those respective files in that respective folder.

  • @msiddiqui4556
    @msiddiqui4556 4 ปีที่แล้ว

    Hi, this video is for one perticular file in folder, how can we check if there are multiple .pdf files in particular folder. If .pdf file exist it should return the value true or highlight that column where the file path is given. Need your support leila, thanx

  • @refinededusoft
    @refinededusoft 2 ปีที่แล้ว

    How can you check whether the file exists without having to write the full path "C:\users\LG...". let's say you're checking whether a file in the same directory as the excel sheet you're writing the macro on...or rather, how do you get the directory of the current spreadsheet?
    please answer soon, my assignment depends on it

  • @assamiyou
    @assamiyou 6 ปีที่แล้ว +1

    Please, would you consider a lesson on how to interact between Excel, Access and SharePoint.

  • @jslaybaugh902
    @jslaybaugh902 5 ปีที่แล้ว

    i could you some help with a vba code to repeat a macro on all the sheets in my workbook

  • @TheLonelymusic
    @TheLonelymusic 4 ปีที่แล้ว

    I want to activate the workbook on error the code is to open the respective workbook from the path. I have tried with the below using on error goto label name.
    On error goto nxt
    WORKBOOKS("filename").activate 'Step 1
    Nxt:
    Workbooks.open filename:=.....'step 2
    On this code macro completed the step 1 and moving to step 2 please help

  • @abdanomer
    @abdanomer 6 ปีที่แล้ว

    Great video as usual
    I have question not a VBA related!😉
    What function can I use to make lookup for multiple items?
    Such as an example I have many student results I want to view the students who has the same results in one cell separated with “,”
    Is that possible?
    I thought of aggregate function with combination with others functions!!

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      This video has the answer: th-cam.com/video/fDB1Ktyhp3Y/w-d-xo.html to get them together in one cell you can use the 2nd formula shown there.

    • @abdanomer
      @abdanomer 6 ปีที่แล้ว

      Leila Gharani
      Thank you 👍🏻
      In my excel 2016 there is no built in TEXTJOIN , so I used an array code for TEXTJOIN from this website codereview.stackexchange.com/questions/180332/test-for-array-vs-range-in-my-textjoin-udf
      It worked greatly using your function

  • @NP-zg3hq
    @NP-zg3hq 5 ปีที่แล้ว

    I have thousands of pdf files with reference like xxxx-yyyy-zzzz each part denotes some structure.
    Is there any vba method available to move the files in to folders based on references structure using match function ?
    A:A - with file names
    B:B - corresponding folders to move individual files

  • @bharanidharan285
    @bharanidharan285 5 ปีที่แล้ว

    Hi,thanks for the good vba explanation, and i want to move on some files one floder to another with of its file name ex- some of the file start with "aaa" it will move to the "A" floder
    can help me

  • @User-xw4dt
    @User-xw4dt 5 ปีที่แล้ว

    Can you make a video of VBA Code for Button -> Make a Pic of the sheet -> open Mail -> paste and write the correct mail adress please. I have a KPI Overview Sheet for my Employees and want to send each of them there KPIs. #ideas #curses #recommend #questions #onenote

  • @berniceabaya9928
    @berniceabaya9928 4 ปีที่แล้ว

    My filename is in korean language and i cannot open the workbook since it returns ?????. Help please

  • @watchvideogame6755
    @watchvideogame6755 6 ปีที่แล้ว

    hello Leila Gharani. I want to ask you, can we create bending moment diagram in excel. (For Civil Engineering Major)

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      I have no idea! Is that similar to the step chart here: th-cam.com/video/2HXigXrTE9I/w-d-xo.html

  • @Mohammad3000100
    @Mohammad3000100 6 ปีที่แล้ว

    Ok, here is the situation most of the time I convert my work to pdf using pdf pro.
    And I use multi sheets workbook.
    But what bothering me is that I always have to write the sheet's name manually.
    Is there away to force the excel to print my sheet with its name not the workbook name.

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      You can define the file name to be a specific sheet name or you can have the names you want inside cells and the macro can use these. There is a good blog post here that might help you: www.contextures.com/excelvbapdf.html

    • @Mohammad3000100
      @Mohammad3000100 6 ปีที่แล้ว

      @@LeilaGharani Thanks Miss Leila that's exactly what I'm looking for.

  • @whoodiniiam
    @whoodiniiam 6 ปีที่แล้ว

    is there a way i can enter a range of values within one cel at the same time put it to graph say 5-20%?????

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      not sure about this.....

  • @gauravmathur4940
    @gauravmathur4940 6 ปีที่แล้ว

    hello, @leila wonderful videos. Always check your videos if i get stuck. Can i ask a question, maybe a topic for a subsequent video. If my data set is from A1-B4 (A1-apple,B1 banana, C1-Oranges, D1 Mangoes) and B1-B4 is quantities. i need to create a visual dynamic basket where if a person enters 4 units of apples - 4 cells show up A, then say 3 Banana subsequent 3 cell are B, and next 0 oranges then nothing in the basket and say 5 mangoes then 5 cell after Banana(B) shows M. is such a thing even possible.

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว

      Thank you Gaurav. Regarding your query, the cells that show up as A, B are they below the headers? So you have B1 - Banana, B2 - Quantity - let's say 2, then you'd like B3-B4 to show a B? Do I understand it properly? If yes, you can type this formula in B3: =IF(ROWS($B$3:B3)

    • @gauravmathur4940
      @gauravmathur4940 6 ปีที่แล้ว

      @@LeilaGharani thanks for your revert. To clarify, i wrote incorrectly, data set is from A1-B4 (A1-apple,A2 banana, A3-Oranges, A4 Mangoes) and B1-B4 is quantities between (1 to 10). My basket is in cell D1 to G10. Now the fun part is if B1=5; B2=6; B3=2; B4=8 (that is 5 units of apples, 6 0f Banana, 2 of Oranges; 8 of Mangoes) then say D1-D5 will have have letter A; D6-D10 & E1 will have letter B; E2 toE3 will have letter O; E4 to E10 & F1-2 will have letter M. So, can we have it filled dynamically so that if value in units (B1 to B4) changes than the letter in the basket will also change ?

  • @shashankgupta8723
    @shashankgupta8723 6 ปีที่แล้ว

    Can u please tell me how to add worksheets using vba?

    • @ricos1497
      @ricos1497 6 ปีที่แล้ว

      Sub addWorksheet()
      Dim wbk as workbook
      Dim wsht as worksheet
      set wbk = activeworkbook 'or Workbooks("someOtherWorkbook")
      set wsht = wbk.Sheets.Add
      End sub
      That's it in its simplest form. You copy this into a module (in visual basic editor, select Insert/Module). You can assign to a button or whatever. The .Sheets.Add statement will allow you to position the sheet, or enter multiple sheets:
      set wsht = wbk.Sheets.Add After:=Sheets("test"), Count:=3 'adds 3 new sheets directly after a sheet called test.
      Hope this helps.

    • @shashankgupta8723
      @shashankgupta8723 6 ปีที่แล้ว

      @@ricos1497 thnaks

  • @Alhusam
    @Alhusam 4 ปีที่แล้ว

    That was pretty neat, however, It would have been more useful if you had explained how to overwrite an existing folder without a prompt.

    • @mbj920
      @mbj920 2 ปีที่แล้ว

      did you ever figure this out?

    • @Alhusam
      @Alhusam 2 ปีที่แล้ว

      @@mbj920 Yes, I did.

  • @raone6822
    @raone6822 6 ปีที่แล้ว

    What can I do if changes path file name??

    • @LeilaGharani
      @LeilaGharani  6 ปีที่แล้ว +1

      You can keep the path name in a cell or use GetOpenFileName to have the user pick the file using the open dialog box.

  • @digildas6822
    @digildas6822 5 ปีที่แล้ว

    Showing path not found

  • @Betterifitsfree
    @Betterifitsfree 6 ปีที่แล้ว

    OUCH! My brain is hurting 🤪

  • @mohammadasad9890
    @mohammadasad9890 6 ปีที่แล้ว

    Hai mam how ru? Mam i want one video how to use excel in logistics plz

  • @codymckinney4934
    @codymckinney4934 5 ปีที่แล้ว

    Type mismatch

  • @naveensingh3267
    @naveensingh3267 5 ปีที่แล้ว

    Thnx leila ,bt i want make a folder with name any date -yyyy.mm..and save my file in to folder with name -DD-MM-YY

  • @desaitejas
    @desaitejas 5 ปีที่แล้ว

    Hello,

  • @candidoprc80
    @candidoprc80 3 ปีที่แล้ว

    Great!!! Leila, please review the function below.
    Sub arquivo_existe()
    Dim NomeArquivo As String
    NomeArquivo = VBA.FileSystem.Dir("C:\Users\Paulo Candido\Downloads\ResultadoLotoFacilCaixa\D_lotman.htm")
    If NomeArquivo = VBA.Constants.vbNullString Then
    MsgBox "Arquivo não existe."
    Else
    MsgBox NomeArquivo
    '< Leila, I ask you: What function do I use to save the file "D_lotman.htm" as "D_lotman.mhtml? >
    End If
    End Sub