Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FormatACTrade(strFilePath As String) 'I'm running this from another _
- sub that exports the tables to excel, I know functions are needed for _
- an output but this is a private variable that I'm using within a modle_
- so should be ok??
- On Error GoTo ErrorHandler
- Set objExcel = CreateObject("Excel.Application")
- objExcel.Visible = False
- objExcel.DisplayAlerts = False
- Set objFso = CreateObject("Scripting.FileSystemObject")
- Set objFolder = objFso.GetFolder(strFilePath)
- If objFso.GetExtensionName(objFile.Path) = "xlsx" Then
- Set objWorkbook = objExcel.Workbooks.Open(objFile.Path)
- For Each sh In objWorkbook.Worksheets
- If sh.UsedRange.Address <> "$A$1" Or sh.Range("A1") <> "" Then
- With sh
- [Do stuff]
- End With
- End If
- Next
- objWorkbook.Close True
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement