Click here to Skip to main content
16,006,348 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSharing SAPI Speech Objects Pin
wheeldog9920-Oct-09 14:52
wheeldog9920-Oct-09 14:52 
AnswerRe: Sharing SAPI Speech Objects Pin
Mycroft Holmes20-Oct-09 16:32
professionalMycroft Holmes20-Oct-09 16:32 
GeneralRe: Sharing SAPI Speech Objects Pin
wheeldog9921-Oct-09 9:26
wheeldog9921-Oct-09 9:26 
QuestionCalling cell address - Excel UDF in a DLL Pin
Hathome20-Oct-09 9:51
Hathome20-Oct-09 9:51 
Question[Message Deleted] Pin
quadrilateral20-Oct-09 8:29
quadrilateral20-Oct-09 8:29 
AnswerRe: SAPI SDK Voices Pin
Richard MacCutchan20-Oct-09 9:08
mveRichard MacCutchan20-Oct-09 9:08 
AnswerRe: SAPI SDK Voices Pin
Christian Graus20-Oct-09 13:04
protectorChristian Graus20-Oct-09 13:04 
QuestionCopy Data from Excel into a Data Grid View Pin
Alex Lush20-Oct-09 6:34
Alex Lush20-Oct-09 6:34 
We have a requirement for the users to be able to paste data from Excel into a Data Grid View in a vb.net application.

I have constructed the following based on the post here[^] on working with the clipboard, and article here[^] on working with XML data .

If Clipboard.ContainsData("XML Spreadsheet") = True Then
            Dim ms As MemoryStream = CType(Clipboard.GetData("XML Spreadsheet"), MemoryStream)
            Dim b(CInt(ms.Length)) As Byte
            ms.Read(b, 0, CInt(ms.Length))
            Debug.Write(CStr(System.Text.UTF7Encoding.UTF8.GetString(b)))
            '=====================================================
            Dim m_xmld As XmlDocument
            Dim m_nodelist As XmlNodeList
            Dim m_node As XmlNode
            'Create the XML Document
            m_xmld = New XmlDocument()

            'Load the Xml content from the clipboard
            m_xmld.LoadXml(System.Text.UTF8Encoding.UTF8.GetString(b))

            'Get the list of name nodes 
            m_nodelist = m_xmld.SelectNodes("/Workbook/Worksheet/Row")

            'Loop through the nodes
            For Each m_node In m_nodelist
                'Row data code here

            Next
            '=====================================================

        Else
            MsgBox("No XML Spreadsheet data on clipboard")
        End If


Am getting the error:
'.', hexadecimal value 0x00, is an invalid character. Line 35, position 1.

Line 35, position 1 corresponds to the end of the XML Spreadsheet data from the clipboard each time.

XML Data is copied from the clipboard OK but don't know if the character encoding is different maybe? Or do I need to strip some characters out?

Just can't seem to get past this error I'm sure its something obvious that I'm missing.
Any ideas?

Thanks in advance.

Alex.
AnswerRe: Copy Data from Excel into a Data Grid View Pin
dan!sh 20-Oct-09 6:52
professional dan!sh 20-Oct-09 6:52 
GeneralRe: Copy Data from Excel into a Data Grid View Pin
Alex Lush21-Oct-09 3:17
Alex Lush21-Oct-09 3:17 
QuestionRichTextBox Contents [Texts, Table] To Email - Body () Pin
Paramu197320-Oct-09 0:02
Paramu197320-Oct-09 0:02 
AnswerRe: RichTextBox Contents [Texts, Table] To Email - Body () Pin
Ashfield20-Oct-09 1:57
Ashfield20-Oct-09 1:57 
GeneralRe: RichTextBox Contents [Texts, Table] To Email - Body () Pin
Paramu197320-Oct-09 2:31
Paramu197320-Oct-09 2:31 
GeneralRe: RichTextBox Contents [Texts, Table] To Email - Body () Pin
Ashfield20-Oct-09 9:11
Ashfield20-Oct-09 9:11 
QuestionHow to Insert a Table from MS-Word Document to Email-Body ? Pin
Paramu197319-Oct-09 23:49
Paramu197319-Oct-09 23:49 
AnswerRe: How to Insert a Table from MS-Word Document to Email-Body ? Pin
Eddy Vluggen20-Oct-09 13:45
professionalEddy Vluggen20-Oct-09 13:45 
QuestionHow to open a cash drawer using VB6 Pin
mwith19-Oct-09 21:49
mwith19-Oct-09 21:49 
AnswerRe: How to open a cash drawer using VB6 Pin
annathor19-Oct-09 22:17
annathor19-Oct-09 22:17 
AnswerRe: How to open a cash drawer using VB6 Pin
Mycroft Holmes19-Oct-09 22:52
professionalMycroft Holmes19-Oct-09 22:52 
AnswerRe: How to open a cash drawer using VB6 Pin
Christian Graus20-Oct-09 0:10
protectorChristian Graus20-Oct-09 0:10 
AnswerRe: How to open a cash drawer using VB6 Pin
The Man from U.N.C.L.E.20-Oct-09 4:41
The Man from U.N.C.L.E.20-Oct-09 4:41 
GeneralRe: How to open a cash drawer using VB6 Pin
Eddy Vluggen20-Oct-09 7:16
professionalEddy Vluggen20-Oct-09 7:16 
GeneralRe: How to open a cash drawer using VB6 Pin
Richard MacCutchan20-Oct-09 9:11
mveRichard MacCutchan20-Oct-09 9:11 
GeneralRe: How to open a cash drawer using VB6 Pin
Christian Graus20-Oct-09 13:05
protectorChristian Graus20-Oct-09 13:05 
GeneralRe: How to open a cash drawer using VB6 Pin
Eddy Vluggen20-Oct-09 15:04
professionalEddy Vluggen20-Oct-09 15:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.