Hi ALL,
first all HAPPY NEW YEAR all MEMBERS of this SITE!
My question is related to refresh method of busobj (I am using BO version 5.1.6)... My code is below
<code>
For Count1 = LBound(TxtNames_H) To UBound(TxtNames_H)
'MsgBox (TxtNames(Count))
Set Doc = Application.Documents.Open("C:\BOReports\" & RepNames(Count1) & ".rep", _
True, False, False, False)
For VariableCount = 1 To Doc.Variables.Count
'MsgBox (Doc.Variables.Item(VariableCount).Name)
If Doc.Variables.Item(VariableCount).Name = "1. Resolution:" Then
Doc.Variables.Item(VariableCount).Value = "Hour"
ElseIf Doc.Variables.Item(VariableCount).Name = "2. Start Time:" Then
Doc.Variables.Item(VariableCount).Value = "04.11.2007 00:00:00"
ElseIf Doc.Variables.Item(VariableCount).Name = "3. Stop Time:" Then
Doc.Variables.Item(VariableCount).Value = "06.12.2007 00:00:00"
End If
Next VariableCount
Doc.Refresh
Doc.Save
Doc.SaveAs ("C:\BOReportsResults\" & TxtNames_H(Count1) & ".txt")
Doc.Close
Next Count1
</code>
After the refreshing the document it had to save all the data to txt file named in variant array...
But what happens is some of the txt files are empty... When I open the report select for the same time period it works fine and then I save it to txt file... it works... But When I run the above code some of the txt files are empty.
I really don't see the problem clearly, but I assume that it should be waiting after the refresh doesn't it? If so is there any method to do so.
Thanks in advance!
first all HAPPY NEW YEAR all MEMBERS of this SITE!
My question is related to refresh method of busobj (I am using BO version 5.1.6)... My code is below
<code>
For Count1 = LBound(TxtNames_H) To UBound(TxtNames_H)
'MsgBox (TxtNames(Count))
Set Doc = Application.Documents.Open("C:\BOReports\" & RepNames(Count1) & ".rep", _
True, False, False, False)
For VariableCount = 1 To Doc.Variables.Count
'MsgBox (Doc.Variables.Item(VariableCount).Name)
If Doc.Variables.Item(VariableCount).Name = "1. Resolution:" Then
Doc.Variables.Item(VariableCount).Value = "Hour"
ElseIf Doc.Variables.Item(VariableCount).Name = "2. Start Time:" Then
Doc.Variables.Item(VariableCount).Value = "04.11.2007 00:00:00"
ElseIf Doc.Variables.Item(VariableCount).Name = "3. Stop Time:" Then
Doc.Variables.Item(VariableCount).Value = "06.12.2007 00:00:00"
End If
Next VariableCount
Doc.Refresh
Doc.Save
Doc.SaveAs ("C:\BOReportsResults\" & TxtNames_H(Count1) & ".txt")
Doc.Close
Next Count1
</code>
After the refreshing the document it had to save all the data to txt file named in variant array...
But what happens is some of the txt files are empty... When I open the report select for the same time period it works fine and then I save it to txt file... it works... But When I run the above code some of the txt files are empty.
I really don't see the problem clearly, but I assume that it should be waiting after the refresh doesn't it? If so is there any method to do so.
Thanks in advance!