title image


Smiley EXCEL-Felder mit einer Access-Abfrage füllen per VBA
so sollte es gehen:Dim RS As Recordset, ExcelObj As Object, I as Long, J as Long On Error Resume Next Err.Clear Set ExcelObj = GetObject(, "Excel.Application ") If Err.Number 0 Then Set ExcelObj = CreateObject("Excel.Application") On Error GoTo 0 I = 0 With ExcelObj .Application.Visible = True .Workbooks.Open "C:/MyXLS.XLS" Set RS = Currentdb.Openrecordset("MeineAbfrage",dbopensnapshot) Do While Not RS.EOF I = I+1 For J = 0 To RS.Count -1 .Cells(I, J+1) = RS(J) Next J RS.Movenext Loop RS.Close '... End WithReinhard

Gruß aus dem Norden

Reinhard


Bitte immer die Access-Version angeben


 



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: