Here is the current Code I have so far. I run into problems at the Z's, I just inserted them as a place marker. A lot is remed out.
Sub Import
Dim xlApp As Object
Dim strDataLine As String
Dim strORDPath As String
Dim xlWrkBook As Object, xlWrkSheet As Object
Dim lCurrSlide As Long
Set xlApp = CreateObject("Excel.Application")
Dim sInputDate As String
Dim sDirPath As String
sInputDate = InputBox(Prompt:="Enter the scenario date (mmm/dd/yyyy).", Title:="Scenario Date", Default:=Format(Now - 1, "mmm/dd/yyyy"))
'Calculate JDay
intYear = year(CDate(sInputDate))
intDays = DateDiff("d", DateSerial(intYear, 1, 0), CDate(sInputDate))
sInputJdate = Format(intDays, "000")
' Set the Daily folder
sDirPath = "Z:\ORD(Edited)\" & Right(sInputDate, 4) & "\" & Right(sInputDate, 4) & "_" & sInputJdate
' Open the Excel workbook
Set xlWrkBook = xlApp.Workbooks.Open(FileName:=sDirPath + "\" & Right(sInputDate, 4) & "_" & sInputJdate & "_v02.ord")
ZZZZZ
Open FileName For Input As #1
While Not (EOF(1)): Line Input #1, a: Wend
Close #1
'ReadORDFile()
Rem Read the ORD(edited).ord file
fn = FreeFile 'opens next file buffer, ussually set to 1
Open sDirPath For Input As #fn 'this opens the ASCII file as input in buffer #fn
Rem Reset row index to 2 for counting outages. Row 1 is for the title.
intRowIndex = 2
Rem Get the current ORD, build path, and open the current ORD.
fn = FreeFile
Open strSOFDrive & strSOFPath For Input As #fn
'Sheets("sheetname").Select
Do While Not EOF(fn)
Line Input #fn, strDataLine
strLineSplit() = Split(strDataLine, Chr(9))
If (strLineSplit(0) Like "*RMS") Then
If strLineSplit(7) = "FCSTDV" Or strLineSplit(7) = "FCSTMX" Then
'Sheets("Outages").Select
'Cells(intRowIndex, 1).Select
ActiveCell.FormulaR1C1 = strLineSplit(1) 'PRN number
'Cells(intRowIndex, 2).Select
ActiveCell.FormulaR1C1 = strLineSplit(3) 'SVN number
intRowIndex = intRowIndex + 1 'increment for next row
End If
End If
Loop
Close fn
'Turn on the screen updates
'Application.ScreenUpdating = True
' Copy ORD DATA picture onto the clipboard
'xlApp.ActiveWindow.Activate
'Sheets("Right(sInputDate, 4) & char95 & sInputJdate & "_v02").Select
'2008_284_v02
'ActiveSheet.ChartObjects("Chart 1").Activate
'ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlScreen, Format:=xlPicture
' Paste to PowerPoint and Resize
'ActiveWindow.View.GotoSlide Index:=2
'ActiveWindow.View.Paste
'With ActiveWindow.Selection.ShapeRange
'.Fill.Transparency = 0#
'.LockAspectRatio = msoFalse
'.Height = 539.88
'.Width = 719.75
'.Left = 0#
'.Top = 0#
'End With
' Close open Workbook
'xlWrkBook.Close (False)
'Close the openworkbook without saving changes
'xlWrkBook.Close (False)
'xlApp.Quit
'Set xlApp = Nothing
'Set xlWrkBook = Nothing
'MsgBox ("Import is complete. Version 1.3")
' End Sub