Skip to Content
0
Former Member
Feb 10, 2009 at 11:50 AM

Not able to schedule deski report with custom Macro

70 Views

Hi All

We have repprts which attached macro in 5x. which is working fine on BCA (5.5.7) , after migration into BOXI R3 not able schedule i.e macro is not working .

When we are running the Deski Report with attached Macro , report is working fine . but when we have schedule , macro is not working

Macro code -

Private Sub Document_AfterRefresh()

Dim DirFile As String

Dim DirFile_pitts As String

Dim DirFile_eur As String

Dim DirFile_sng As String

Dim DirFile_cinn As String

Dim DirFile_sng_old As String

Dim File As String

Dim Path As String

Dim Path1 As String

Dim Path_pitts As String

Dim Path_eur As String

Dim Path_cinn As String

Dim Path_sng As String

Dim Path_sng_old As String

Dim Dir1File As String

Dim flag As Boolean

Dim vars As DocumentVariables

Dim var As DocumentVariable

Dim doc As Document

Set doc = ThisDocument

Set vars = doc.DocumentVariables

Dim LoadWeek As String

' Dim Year As String

Dim i As Integer

Dim myarr_week As Variant

Dim arr_size_week As Integer

Dim myarr_yr As Variant

Dim arr_size_yr As Integer

Dim k

For i = 1 To vars.Count

Set var = vars.Item(i)

If var.Name = "Loadweek" Then

arr_size_week = UBound(var.Values(BoAllValues))

myarr_week = var.Values(BoAllValues)

End If

' If var.Name = "Current Year" Then

' arr_size_yr = UBound(var.Values(BoAllValues))

' myarr_yr = var.Values(BoAllValues)

' End If

Next i

For k = 1 To arr_size_week

LoadWeek = myarr_week(k)

'Else

'MsgBox "invalid Value"

' 'MsgBox week

Next k

' For k = 1 To arr_size_yr

' Year = myarr_yr(k)

' 'MsgBox Year

' Next k

'Local Path

'DirFile = "C:\Arvind\REPORTS\dashboard\"

'for BO Xi Test

DirFile = "
swpit101v.global.sabic-ip.com\www_geam-p_BCA\pacificEDW\scm\"

'BOXI Path

Path = DirFile & "GEP_Australia_SCM_Dashboard" & "_" & LoadWeek

'BOXI Flag

flag = Application.ActiveDocument.ActiveReport.ExportAsHtml(Path, 1, 1, 1, 1, 1, 1, 0, 0, 0)

End Sub

Please help to fix this and suggest us

Thanks in advance

Ajay

Call me my # +91-011-9899059037

Edited by: ajay gupta on Feb 10, 2009 12:51 PM

Edited by: ajay gupta on Feb 10, 2009 12:53 PM

Edited by: ajay gupta on Feb 10, 2009 3:26 PM