Prikazi cijelu temu 06.12.2012 09:17
miro35 Van mreze
Clan
Registrovan od:05.01.2009
Lokacija:-


Predmet:Re: export u excel (redosled kao u reportu)
Evo nešto što sam ja našao ali neznam radi li:
PreuzmiIzvorni kôd (Text):
  1. Dim appExcel As Excel.Application
  2. Dim wbk As Excel.Workbook
  3. Dim wks As Excel.Worksheet
  4.  
  5. Dim sOutput As String
  6.  
  7. Dim rng As Range
  8. Dim dbs As DAO.Database
  9. Dim rst As DAO.Recordset
  10. Dim sSQL As String
  11.  
  12. Const cTabTwo As Byte = 1
  13.  
  14. DoCmd.Hourglass True
  15.  
  16. ' set to break on all errors
  17. Application.SetOption "Error Trapping", 0
  18.  
  19. sOutput = CurrentProject.Path & "c:\Book1.xls"
  20.  
  21. ' Create the Excel Applicaiton, Workbook and Worksheet and Database object
  22. Set appExcel = Excel.Application
  23. Set wbk = appExcel.Workbooks.Open(sOutput)
  24. Set wks = appExcel.Worksheets(cTabTwo)
  25.  
  26.  
  27. sSQL = "select * from qry_Client_Ranking"
  28. Set dbs = CurrentDb
  29. Set rst = dbs.OpenRecordset(sSQL, dbOpenSnapshot)
  30.  
  31. Set rng = A1: G26 (How TO DEFINE THE RANGE OBJECT?)
  32. rng.CopyFromRecordset rst
Ima toga još guglaj malo; upiši ovo u google:vba export access to excel
Miro