PeopleSoft Adoption Made Smooth & Simple!
On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool. Claim Your Free WalkMe Account Now
5. Vbscript file RUN_MACRO.VBS Dim xlApp, xlBook Set xlApp = CreateObject("Excel.Application") '~~> Change Path here Set xlBook = xlApp.Workbooks.Open("C:\dq_export\Macro_run.xls", 0, True) xlApp.Run "Macro_run!Loopfiles" 'xlBook.Close 'xlApp.Quit Set xlBook = Nothing Set xlApp = Nothing 'WScript.Echo "Finished." 'WScript.Quit 6. Excel Macro code (this code is located inside of the the macro_run.xls file) Sub Loopfiles() Dim wb As Workbook Dim myPath As String Dim myfile As String Dim myExtension As String Dim FldrPicker As FileDialog 'Optimize Macro Speed Application.ScreenUpdating = False Application.EnableEvents = False Application.Calculation = xlCalculationManual myPath = "c:\dq_export\csv\" myfile = Dir(myPath & "\" & "*.csv") 'Loop through each Excel file in folder Do While myfile <> "" 'Set variable equal to opened workbook Set wb = Workbooks.Open(Filename:=myPath & myfile) ';;;;;;;;;;;;;;WRITE YOUR CODE HERE FormatResult testMacro ' wb.Close SaveChanges:=True With wb .SaveAs Replace("c:\dq_export\excel\" & myfile, ".CSV", ".xls"), 50 'UPDATE: .Close True End With 'Get next file name myfile = Dir Loop 'Message Box when tasks are completed ' MsgBox "Task Complete!" ResetSettings: 'Reset Macro Optimization Settings Application.EnableEvents = True Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True Application.DisplayAlerts = False Application.Quit End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Merge two Google Chrome Bookmark files or convert Excel list into an HTML file||3||38|
|Search for a certain number and select cells using VBA||9||19|
|Excel 2016 - How to prevent inserted column from inheriting attributes of column to the left||8||15|
|I NEED KEEP THE CONDITIONAL FORMATTING||24||31|