Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 15th, 2005, 10:44 AM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default export data 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??








Similar Threads
Thread Thread Starter Forum Replies Last Post
Export to Excel (Data only) nikks9 ASP.NET 1.0 and 1.1 Professional 3 February 9th, 2011 05:01 AM
Export Data to Excel seananderson Access 2 January 16th, 2007 12:30 PM
Export Data to Excel msbsam ASP.NET 2.0 Basics 0 November 8th, 2006 02:09 AM
How to export data into Excel lily611 General .NET 8 January 11th, 2006 10:02 PM
export data to excel tulincim Classic ASP Databases 0 August 22nd, 2005 03:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.