The spreadsheet I have is a 2003 version and works fine with 2003. However,
when I open the spreadsheet with Excel 2007 and click on the button to export
data it gives the message:
Compile error in hidden module: sheet 1.
So I unprotect the sheet and workbook and get the message
Compile error: can't find project or library.
I know the code below works and compiles just fine in 2003 however it does
not work in excel 2007.
I am not familiar enough with what REFERENCE to choose or add-in that would
help ...
Private Sub save_Click()
Dim FName As String
Dim RowTxt As String
Dim currPath As String
Dim naic As String
Dim taxyear As String
Dim i As Integer
Dim j As Integer
naic = UCase$(Range("B4:B4").Value)
comp = UCase$(Range("B6:B6").Value)
mode_f = Range("D4
4").Value
taxyear = Range("D6
6").Value
currPath = ActiveWorkbook.Path
FName = currPath & "\" & naic & "_TAXDATA.TXT"
Open FName For Output As #1
i = 1
j = 13
Do While i < 10000
RowTxt = naic & "||" & comp & "||" & taxyear & "||" & mode_f & "||" &
Range("A" & j).Value & "||" & Range("D" & j).Value & "||" & Range("E" &
j).Value & "||"
If (Range("A" & j).Value) <> "" And Range("D" & j).Value <> "" And
Range("E" & j).Value <> "" Then
Print #1, RowTxt
End If
i = i + 1
j = j + 1
Loop
Close #1
MsgBox ("Formated Data is stored in " & FName)
End Sub