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

VB2005 i Excel2007 automatizacija

[es] :: .NET :: VB2005 i Excel2007 automatizacija

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

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

manix
IDD Lab
Arilje

Član broj: 9936
Poruke: 482
*.beotel.net.

Sajt: www.lendovisanje.com


Profil

icon VB2005 i Excel2007 automatizacija06.03.2007. u 22:37 - pre 208 meseci
Code:
Public Class Form1
    Dim objExel As Excel.Application
    Dim oWB As Excel.Workbook
    Dim oSheet As Excel.Worksheet

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        objExel = CreateObject("Excel.Application")
        objExel.Visible = True
        Dim xx As Excel.XlWBATemplate
        xx = Excel.XlWBATemplate.xlWBATWorksheet
        oWB = objExel.Workbooks.Add(xx) ''Ovde javlja gresku "Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))"
        oSheet = oWB.ActiveSheet
    End Sub
End Class


Da li neko ima reeeeseeenje???
 
Odgovor na temu

manix
IDD Lab
Arilje

Član broj: 9936
Poruke: 482
*.beotel.net.

Sajt: www.lendovisanje.com


Profil

icon Re: VB2005 i Excel2007 automatizacija06.03.2007. u 22:48 - pre 208 meseci
Ljudi postavio sam pitanje pre 10 min , posle 2 sata pretrage po netu, a sada sam nasao resenje.

Code:
        Dim oExc As New Excel.Application()
        oExc.Visible = True
        oExc.UserControl = True
        Dim oBooks As Object = oExc.Workbooks
        Dim ci As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("en-US")
        oBooks.GetType().InvokeMember("Add", Reflection.BindingFlags.InvokeMethod, Nothing, oBooks, Nothing, ci)


Pa ako nekom' ztreba tu je!

Pozdrav
 
Odgovor na temu

manix
IDD Lab
Arilje

Član broj: 9936
Poruke: 482
*.blueisp.co.yu.

Sajt: www.lendovisanje.com


Profil

icon Re: VB2005 i Excel2007 automatizacija08.03.2007. u 00:35 - pre 208 meseci
Zapravo

Code:
Dim oExc As New Excel.Application()
oExc.Visible = True
oExc.UserControl = True
Dim oldCI As System.Globalization.CultureInfo = _
    System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = _
    New System.Globalization.CultureInfo("en-US")

' Excel comande ....

System.Threading.Thread.CurrentThread.CurrentCulture = oldCI


Ali ima drugi problem: format odredjene kolone???

Znaci, iz VB-a posaljem podatak sa 15 cifara kao string a u Excelu je ta kolona Standard i on ga
tretira kao number i dobije nesto tips 3,69854E+14...
kako da resim problem??

hvala unapred!
 
Odgovor na temu

[es] :: .NET :: VB2005 i Excel2007 automatizacija

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

Postavi temu Odgovori

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