Page 1 of 1

Automate Excel with VBScript to process Nagios Logs

PostPosted: Thu Sep 29, 2022 2:20 am
by FramJamesgot
I'm using VBScript to extract a LOG file from Nagios XI. I have automated a script that will use IE.Aplication navigate, choose the right parameters (to filter) and export as CSV (Excel usable). That has been done!

Now I want to filter MORE (of what Nagios can't do). I have multiple logs of CPU, and I want to DELETE ALL the rows contain this word. I found lots of scripts in VBA, but the problem in my case that I override the file each use this is the vba script I use (in another Excel). I need to change it to work from "outside" of the application (meaning from the main script)

Sub CellColor(rng As Range)
For Each row In rng.Rows
For Each cell In row.Cells
If cell.Value = ActiveCell.Value Then '--- The Condition of the function
cell.Style = "Bad" '--- Changing the "Style" atribbute
cell.Style = "Good" '--- Changing the "Style" atribbute
End If
Next cell
Next row
End Sub
Can any body advise on how to convert this?