Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Access i exscel celija

[es] :: Access :: Access i exscel celija

[ Pregleda: 1940 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

vladakru

Član broj: 11515
Poruke: 1218
178.79.29.*



+4 Profil

icon Access i exscel celija19.04.2014. u 15:04 - pre 121 meseci
jel moguce i naravno kako :) da celiju iz access tabele upisujem u odredjenu excel celiju?
tj, potrebno mi je da u formiranu i graficki doteranu excel tabelu upisujem podatke koji se unose u Access bazu.
by Vladakru
 
Odgovor na temu

vladakru

Član broj: 11515
Poruke: 1218
178.79.40.*



+4 Profil

icon Re: Access i exscel celija22.04.2014. u 21:40 - pre 120 meseci
any help?
by Vladakru
 
Odgovor na temu

Trtko
Koprivnica

Član broj: 69494
Poruke: 695
*.adsl.net.t-com.hr.



+8 Profil

icon Re: Access i exscel celija15.05.2014. u 09:39 - pre 120 meseci
Evo ti moja funkcija koja je prepisivala iz acces tabele u neku excel tabelu ...
malo prouči kod, prvo moraš otvoriti excel fajl i onda u njega upisuješ , i ne zaboravi da moraš i na kraju zatvoriti excel fajl

Da i u referencama moraš uključiti Microsoft Excel object library


Private Sub tipeks_Click()

PPDEF = Application.CurrentProject.Path
PPopen = PPDEF + "\prazna.xls"
dput = Dir(PPopen)


If Len(dput) < 3 Then
MsgBox "NE POSTOJI EXCEL TABLICA " + PPopen + " MORATE JE KREIRATI"
Exit Sub
End If

Set objexcel = CreateObject("Excel.Application")
objexcel.Workbooks.Open (PPopen)

objexcel.Application.Visible = True


Dim dato11 As Database
Dim rek11 As Recordset
Set dato11 = CurrentDb
Dim sqlupit11 As String
sqlupit11 = "select * from finstatement"
Set rek11 = dato11.OpenRecordset(sqlupit11)

kolona = 1
Do While Not rek11.EOF

objexcel.Cells(1, kolona).Value = rek11.Fields("CompanyName").Value
objexcel.Cells(2, kolona).Value = rek11.Fields("CurrencyUnit").Value
objexcel.Cells(3, kolona).Value = rek11.Fields("Currency").Value
objexcel.Cells(4, kolona).Value = rek11.Fields("startdate").Value
objexcel.Cells(5, kolona).Value = rek11.Fields("enddate").Value
objexcel.Cells(6, kolona).Value = rek11.Fields("version").Value


statid = rek11.Fields("statementid").Value


Dim dato2 As Database
Dim rek2 As Recordset
Set dato2 = CurrentDb
Dim sqlupit2 As String
sqlupit2 = "select * from finitem where statementid=" & statid
Set rek2 = dato2.OpenRecordset(sqlupit2)


red = 10

Do While Not rek2.EOF
objexcel.Cells(red, kolona).Value = "'" & rek2.Fields("accountid").Value
objexcel.Cells(red, kolona + 1).Value = rek2.Fields("Accountvalue").Value
red = red + 1
rek2.MoveNext
Loop
rek2.Close
Set dato2 = Nothing

kolona = kolona + 2
rek11.MoveNext
Loop


rek11.Close
Set dato11 = Nothing


objexcel.Application.Visible = False

objexcel.Application.DisplayAlerts = False


odmjdefault = "FPuvozDRVO_" + Format(DATUMOD, "mm") + "_" + Format(datumdo, "mm") + "_" + Format(datumdo, "yyyy")
odmj = InputBox("Unesi ime .XLS datoteke", "EXPORT PODATAKA", odmjdefault)



PPDEF = Application.CurrentProject.Path
ppexcel = PPDEF + "\" + odmj
dput = Dir(ppexcel)

If IsNull(odmj) Or odmj = "" Then
odmj = odmjdefault
End If

If Len(dput) < 3 Then

Else
Kill (ppexcel + "\" + odmj)
End If

objexcel.Workbooks(1).SaveAs PPDEF + "\" + odmj
objexcel.Application.Quit
objexcel.Application.DisplayAlerts = True

MsgBox "Podaci su prepisani u " + PPDEF + "\" + odmj + ".XLS"
End Sub
 
Odgovor na temu

[es] :: Access :: Access i exscel celija

[ Pregleda: 1940 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.