LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.fr.excel,microsoft.public.fr.vb,microsoft.public.vb.general.discussion,microsoft.public.vb.ole
external usenet poster
 
Posts: 4
Default Excel - erreur Automation

Bonjour,

J'ai développé un système multi-application d'ont une communique avec MS
Excel via des objets. Je les utilises pour insérer des données dans mon
fichier, j'y appel 2 macros (Sub public dans ma feuille 1), je l'enregistre
puis le l'ouvre pour permettre à l'usager de saisir ses données. Au moment
de la sauvegarde, certain poste déclanche une "Erreur Automation"*. Je vous
donne un extrait de mon code qui inter-agit entre vb et excel. Fait
éronnant, l'erreur ne se produit que suir certain poste. Pourriez-vous me
renseigner sur ce type d'erreur?

Une aide serait grandement appréciée

Merci

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''
' Crée une nouvelle feuille de temps selon le modèle maître, l'enregistre
' dans l'emplacement choisi par l'utilisateur et l'ouvre
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''
Private Sub createTS(ByRef obj As Excel.Application, strPath As String,
strLogo As String, _
intModele As Integer)
Dim ws As Excel.Worksheet
Dim intJourSemaine As Integer

On Error GoTo Erreurs

'On crée une copie du fichier maître pour l'entrer d'une nouvelle
'feuille de temps
FileCopy strPath, strPathSave
obj.Workbooks.Open strPathSave

'On désactive les events pour l'insertion des données
obj.EnableEvents = False

'Inscription des paramètres de l'en-tête de la feuille de temps
With obj.ActiveSheet
.Unprotect "ti2004"
.Cells(2, 1) = typEmp.strCie
.Cells(2, 2) = typEmp.strNoEmp
.Cells(2, 11) = CDate(cboEndWeek.List(cboEndWeek.ListIndex))
.Cells(4, 1) = UCase(typEmp.strName)
.Cells(4, 6) = UCase(typEmp.strFirstName)
.Cells(12, 5).Select

'Chargement du logo
.setImage (strLogo)
.setTaches (intModele)
'.setVersion (VERSION)
'MsgBox "14", vbOKOnly
.Protect "ti2004"
End With

obj.Workbooks(getFileName(cboEndWeek.List(cboEndWe ek.ListIndex))).Save
'obj.ActiveWorkbook.Save
obj.Workbooks(getFileName(cboEndWeek.List(cboEndWe ek.ListIndex))).Saved
= False
obj.EnableEvents = True
obj.Visible = True
dteDateMod = FileDateTime(strPathSave)

Exit Sub

Erreurs:
MsgBox Err.Description & " " & Err.Source, vbInformation, "VB"
obj.Quit
End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel automation zino Excel Programming 1 December 29th 04 11:55 AM
Excel automation in MFC charian Excel Programming 0 July 20th 04 03:45 AM
Ole automation with Excel 10 from Vb.net Richie Weldon \(MSFT\) Excel Programming 0 November 13th 03 06:08 PM
Excel Web Automation mccaka Excel Programming 1 October 9th 03 02:18 AM
Vb.net - excel 97 automation michael Excel Programming 0 August 14th 03 06:16 PM


All times are GMT +1. The time now is 02:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"