vbscript - export to excel ???

A

amy_mgfe

Hi,

I'm trying to export data to a new Excel Sheet as an application. And I am
using the following VBScript sub:





Sub print2(controlID)

dim sButtonClicked, sHTML, pos, sButtonHTML, oExcel,
oBook, Elements, tblTOExport

sButtonClicked = controlID & "_hlkExportTOExcel"

Set Elements = document.all.tags("table")

FOR i=0 TO Elements.length -1

pos = InStr(Elements.Item(i).innerHTML, sButtonClicked)

if pos > 0 then

tblTOExport = Elements.Item(i).Id

Exit For

end if

NEXT

sHTML = document.all.item(tblTOExport).outerHTML

sButtonHTML = document.all.item(sButtonClicked).outerHTML

sHTML = Replace(sHTML, sButtonHTML, " ")

set oExcel = createobject("Excel.application")

set oBook = oExcel.Workbooks.Add

oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML

oBook.HTMLProject.RefreshDocument

oExcel.Visible = True

oExcel.UserControl = True

End Sub



I've two problems :

1) In the formed sheet I cannot see Turkish characters correctly. I'm losing
actual letters, is there a need to set the encoding / language to Turkish, if
there is how can I do that?



2) I want to remove the Hyperlinks in the sheet but when I use
WorkSheet.Hyperlinks.Delete I'm also losing the formatting.



Any help??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top