HELP!!! Problem beim Übertragen von Excel in PDF
31.01.2007 14:53:30
Excel
Habe folgendes Problem please HELP!!!
Habe VBA-Code zum Datenübertragen von Excel in PDF Formular (unten)
Alles prima und funktioniert aber sobald ich in die Zelle eine Zahl oder
eine Formel eintrage kommt Laufzeitfehler "5"
Kann man das irgendwie korrigieren?
Vielen dank im voraus!!!!!!!
Sub Makro1()
Dim pdfPath As String
'Dim pdDoc As Acrobat.CAcroPDDoc
'Dim avDoc As Acrobat.CAcroAVDoc
'Dim acroApp As Acrobat.CAcroApp
Dim pdDoc As Object
Dim avDoc As Object
Dim acroApp As Object
Dim jsObj As Object
Dim fieldObj As Object
' hier liegt die Test Datei
pdfPath = "c:\testDatei.pdf"
Set acroApp = CreateObject("AcroExch.App")
Set avDoc = CreateObject("AcroExch.avDoc")
acroApp.Show
' doc öffnen
If avDoc.Open(pdfPath, "form1") Then
Set pdDoc = avDoc.GetPDDoc()
Set jsObj = pdDoc.GetJSObject()
' Zugriff auf das Feld
Set fieldObj = jsObj.getField("Name")
' ... und wert setzen
fieldObj.Value = Worksheets("tabelle1").Range("A2").Value
' aufräumen
Set pdDoc = Nothing
Set avDoc = Nothing
Set acroApp = Nothing
End If
End Sub