Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCA problems

Status
Not open for further replies.

anykase

Technical User
Jun 28, 2002
5
0
0
FR
I have this VBA code, which perfectly works when I execute it "myself". However, it doesn't work when I execute it through BCA. Is someone know the reason ?

the following code is :

Option Explicit
Dim NbLignes As Integer

Dim i As Integer

Dim docmaitre As Document
Dim docesclave As Document
Dim dpcsrh As DataProvider
Dim colonnesmaitre As Columns
' La colonne des CSRH
Dim colcsrh As Column
' La colonne des dates
Dim coldate As Column


'--------------------
' procédure principale
'--------------------

Sub auto_open()

' On passe en mode NON INTERACTIF pour éviter les msgBox
Application.Interactive = False


' Mode accès au référentiel
Application.ExchangeMode = boRepositoryMode
Application.ExchangeDomain = "aderh_dom"

' Ouverture et Rafraîchissement de l'état "Liste CSRH"
Application.Documents.Receive ("Liste CSRH")
Set docmaitre = Application.Documents.Open("Liste CSRH")
docmaitre.Refresh

' Utilisation des données rafraîchies pour paramétrer l'état "test"
Set dpcsrh = docmaitre.DataProviders.Item(1)
Set colonnesmaitre = dpcsrh.Columns
Set colcsrh = colonnesmaitre.Item(1)
Set coldate = colonnesmaitre.Item(2)

NbLignes = colcsrh.Count

' Ouverture de l'état "test"
Application.Documents.Receive ("test")
Set docesclave = Application.Documents.Open("test")

For i = 1 To NbLignes
DoEvents

' Affectation d'un CSRH
Application.Variables.Item("Choix du (des) CSRH, * pour le global").Value = colcsrh.Item(i)
' Affectation de la date
Application.Variables.Item("Choix du dernier mois du trimestre (200109;200110; ...) :").Value = coldate.Item(1)

' Rafraichissement de l'état "test" paramétré avec les nouvelles valeurs
docesclave.Refresh

Next

docmaitre.Close
Set docmaitre = Nothing
docesclave.Close
Set docesclave = Nothing

Application.Interactive = True

End Sub
 
What is the error message you are getting??? What is the basic funda behind running the Code at BCA Server???? The code seems to be retrieving a file from repository and putting some value to prompts. But would help if you provide more details regarding the error. Also you can execute the code step by step.

Good Luck
Sri
 
I don't get any error message, in the BCA console, it just shows "echec" that's why I don't understand.

when I execute the macro step by step, it works perfectly.
 
You need to log each step of the macro (and errors raised from VB) to event viewer or file, since BCA errors are quite unuclear.
One thing that comes to my mind is that the error could be related to user permissions.

Stick to your guns
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top