Hi!
I'm exporting data from some grid to excel.
If i have value in grid like; 2.57 or 10.98,
excel converts these values into: feb.57 and okt.98 !
i don't want excel to convert these values
Is there any way to switch off formating in excel when exporting?
i'm working with a VB script, this is a code:
sub izvoziExcel
Dim sHTML,oExcel,oBook,oCells
naslovR=document.getElementById("naslovReklame").Value
if naslovR<>"" then
vsebinaR=document.all.item("tblReklame").outerHtml
dolzina=instr(1,vsebinaR,"<tr",1)
vsebina1=mid(vsebinaR,1,dolzina-1)
dolzina=instr(1,vsebinaR,"</tr>",1)
vsebinaR=vsebina1&naslovR&mid(vsebinaR,dolzina+5)&"<p></p>"'"<table><tr><td></td></tr></table>"
end if
naslovB=document.getElementById("naslovBreklam").Value
if naslovB<>"" then
vsebinaB=document.all.item("tblBreklam").outerHtml
dolzina=instr(1,vsebinaB,"<tr",1)
vsebina1=mid(vsebinaB,1,dolzina-1)
dolzina=instr(1,vsebinaB,"</tr>",1)
vsebinaB=vsebina1&naslovB&mid(vsebinaB,dolzina+5)&"<p></p>"'"<table><tr><td></td></tr></table>"
end if
naslovS=document.getElementById("naslovSkupaj").Value
if naslovS<>"" then
vsebinaS=document.all.item("tblSkupaj").outerHtml
'kako zbrisem prvo vrstico
dolzina=instr(1,vsebinaS,"<tr",1)
vsebina1=mid(vsebinaS,1,dolzina-1)
dolzina=instr(1,vsebinaS,"</tr>",1)
vsebinaS=vsebina1&naslovS&mid(vsebinaS,dolzina+5)
end if
if vsebinaR<>"" OR vsebinaB<>"" OR vsebinaS<>"" then
set oExcel=CreateObject("Excel.Application")
Set oBook=oExcel.Workbooks.Add
oBook.HTMLProject.
oBook.HTMLProject.HTMLProjectItems(1).Text=vsebinaR&vsebinaB&vsebinaS
oBook.HTMLProject.RefreshDocument
oExcel.Visible=true
oExcel.UserControl=true
end if
end sub
Thanks!
G.
I'm exporting data from some grid to excel.
If i have value in grid like; 2.57 or 10.98,
excel converts these values into: feb.57 and okt.98 !
i don't want excel to convert these values
Is there any way to switch off formating in excel when exporting?
i'm working with a VB script, this is a code:
sub izvoziExcel
Dim sHTML,oExcel,oBook,oCells
naslovR=document.getElementById("naslovReklame").Value
if naslovR<>"" then
vsebinaR=document.all.item("tblReklame").outerHtml
dolzina=instr(1,vsebinaR,"<tr",1)
vsebina1=mid(vsebinaR,1,dolzina-1)
dolzina=instr(1,vsebinaR,"</tr>",1)
vsebinaR=vsebina1&naslovR&mid(vsebinaR,dolzina+5)&"<p></p>"'"<table><tr><td></td></tr></table>"
end if
naslovB=document.getElementById("naslovBreklam").Value
if naslovB<>"" then
vsebinaB=document.all.item("tblBreklam").outerHtml
dolzina=instr(1,vsebinaB,"<tr",1)
vsebina1=mid(vsebinaB,1,dolzina-1)
dolzina=instr(1,vsebinaB,"</tr>",1)
vsebinaB=vsebina1&naslovB&mid(vsebinaB,dolzina+5)&"<p></p>"'"<table><tr><td></td></tr></table>"
end if
naslovS=document.getElementById("naslovSkupaj").Value
if naslovS<>"" then
vsebinaS=document.all.item("tblSkupaj").outerHtml
'kako zbrisem prvo vrstico
dolzina=instr(1,vsebinaS,"<tr",1)
vsebina1=mid(vsebinaS,1,dolzina-1)
dolzina=instr(1,vsebinaS,"</tr>",1)
vsebinaS=vsebina1&naslovS&mid(vsebinaS,dolzina+5)
end if
if vsebinaR<>"" OR vsebinaB<>"" OR vsebinaS<>"" then
set oExcel=CreateObject("Excel.Application")
Set oBook=oExcel.Workbooks.Add
oBook.HTMLProject.
oBook.HTMLProject.HTMLProjectItems(1).Text=vsebinaR&vsebinaB&vsebinaS
oBook.HTMLProject.RefreshDocument
oExcel.Visible=true
oExcel.UserControl=true
end if
end sub
Thanks!
G.