Click here to Skip to main content
16,004,977 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionAdding Attributes to XML node using VBA Pin
priyaahh17-Jul-10 7:12
priyaahh17-Jul-10 7:12 
AnswerRe: Adding Attributes to XML node using VBA Pin
DaveAuld17-Jul-10 10:08
professionalDaveAuld17-Jul-10 10:08 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh17-Jul-10 11:37
priyaahh17-Jul-10 11:37 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 1:43
professionalDaveAuld18-Jul-10 1:43 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 7:39
priyaahh18-Jul-10 7:39 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 7:44
professionalDaveAuld18-Jul-10 7:44 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 8:51
priyaahh18-Jul-10 8:51 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 9:51
professionalDaveAuld18-Jul-10 9:51 
1) can you edit your message and put the code in a code block with an attribute lang="vb", so it formats something more readable!

2) Do not user On Error Resume Next, how else will you trap problems

Change to On Error Goto ERROR_HANDLER, then at the end of the function put;

<PRE lang="vb">
' Return the HTML string...
fGenerateXML = strXML
Exit Function

ERROR_HANDLER:

MSGBOX "Error: " & Err.description

End Function
</pre>

3) You are doing far too much in the single function, split it up into smaller helper functions, one to create nodes, one to add attributes etc. It will be easier to program and follow.

Dave

<i>Don't forget to rate messages!</i><br><strong>Find Me On:</strong> <a href="http://www.dave-auld.net/" target="_blank">Web</a>|<a href="http://www.facebook.com/dave.m.auld/" target="_blank">Facebook</a>|<a href="http://www.twitter.com/daveauld/" target="_blank">Twitter</a>|<a href="http://www.linkedin.com/in/daveauld" target="_blank">LinkedIn</a><br>Waving? dave.m.auld[at]googlewave.com</br></br>
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 10:07
priyaahh18-Jul-10 10:07 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 10:51
professionalDaveAuld18-Jul-10 10:51 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 10:59
priyaahh18-Jul-10 10:59 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 11:08
professionalDaveAuld18-Jul-10 11:08 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 11:47
priyaahh18-Jul-10 11:47 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 12:10
professionalDaveAuld18-Jul-10 12:10 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 13:38
priyaahh18-Jul-10 13:38 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 14:00
professionalDaveAuld18-Jul-10 14:00 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 19:44
priyaahh18-Jul-10 19:44 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 22:23
professionalDaveAuld18-Jul-10 22:23 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 22:59
priyaahh18-Jul-10 22:59 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 23:17
professionalDaveAuld18-Jul-10 23:17 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 23:32
priyaahh18-Jul-10 23:32 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld18-Jul-10 23:48
professionalDaveAuld18-Jul-10 23:48 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh18-Jul-10 23:59
priyaahh18-Jul-10 23:59 
GeneralRe: Adding Attributes to XML node using VBA Pin
DaveAuld19-Jul-10 0:02
professionalDaveAuld19-Jul-10 0:02 
GeneralRe: Adding Attributes to XML node using VBA Pin
priyaahh21-Jul-10 1:26
priyaahh21-Jul-10 1:26 

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.