Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vbscript - export to excel ???

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??


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run VBScript from Excel Amy M Excel Discussion (Misc queries) 4 September 19th 08 09:07 PM
VBScript code behind Excel jjjjj Excel Programming 2 November 23rd 04 10:36 PM
Opening excel spreadsheet from within a VBscript Disco[_2_] Excel Programming 7 January 23rd 04 03:50 PM
embed excel in ie using vbscript balaji kandan Excel Programming 0 November 22nd 03 09:47 AM
how to kill excel using a vbscript Harald Staff[_4_] Excel Programming 0 July 17th 03 10:02 PM


All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"