Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating data - exporting to Excel

Status
Not open for further replies.

PIAS

Programmer
Nov 2, 2005
38
0
0
SI
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?

Thanks!

G.

 
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
 
Try the VBScript forum then (forum329)


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top