Consulting

Results 1 to 4 of 4

Thread: Problem With Macro

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Jan 2018
    Posts
    2
    Location

    Problem With Macro

    Hi,

    below my Macro:

    Sub AllFiles()
        Dim folderPath As String
        Dim filename As String
        Dim wb As Workbook
      
        folderPath = "C:\Users\Dom\Desktop\Bob"
        
        If Right(folderPath, 1) <> "\" Then folderPath = folderPath + "\"
        
        filename = Dir(folderPath & "*.csv")
        Do While filename <> ""
          Application.ScreenUpdating = False
            Set wb = Workbooks.Open(folderPath, Local:=True & filename)
             
    
    
            Call ChangeFile
            
            
            filename = Dir
        Loop
      Application.ScreenUpdating = True
    End Sub
    I need to open CSV file with data like Excel, so I wrote Local:=True, but then i have error:"run time error 1004 method open of object workbooks failed"

    Any help is greatly appreciated!!
    Last edited by Paul_Hossler; 01-17-2018 at 05:40 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •