PC Review


Reply
Thread Tools Rate Thread

Attaching a xml schema to a excel worksheet

 
 
=?Utf-8?B?SWFuIE1hYw==?=
Guest
Posts: n/a
 
      4th Jul 2007
This has to be so simple its untrue, but nowhere can I find how to achieve this
simple task, using VB.
I can do the task manually very easily.
create a new worksheet. - Insert -> worksheet
attach schema - data -> xml -> xml source...
in xml Source frame click on XML Maps....
in XML Maps window click on Add
in Select XML Source window select appropriate .xsd file and click open
back to XML Maps window and ok
structure appears in XML source window.

I can also do all the above with VB thus :-

Dim xmlSheet As Worksheet
Set xmlSheet = Worksheets.Add(After:=Sheets("sheet9"))
xmlSheet.Name = "XmlData"

Set xmlObj =
ActiveWorkbook.XmlMaps.Add("C:\subversion\FM\xml\simulate.xsd",
"data")
xmlObj.Name = "data_Map"

Now the next bit is dead easy manually,
go into the XML Source frame click on the top level object in the maps window
to select it now point at it, click and drag to worksheet cell A1 and drop
and the whole structure list appears with all the correct headings in the
columns and as a list as the xml schema says.

So whats the VB to do this?
I've tried macro record and it shows nothing.
I can get as far as creating the list but then I have to puts the names in as
literals in the code, which is odd as they are already know. but only seem
to appear in the .xml object as a string of the schema source, which I would
have to process. There must be an easier way

Help please.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedding an Excel 2007 worksheet into an email without attaching Peoplemover13 Microsoft Excel Misc 2 9th Jul 2009 08:36 PM
Excel stops responding after attaching worksheet to email sjs Microsoft Excel Crashes 0 8th Oct 2008 03:46 PM
Attaching an Excel Worksheet as An Object... Bob Barnes Microsoft Excel Programming 0 24th Apr 2008 09:33 PM
Getting the SChema from an excel worksheet Robert Bravery Microsoft C# .NET 0 4th Jul 2006 01:34 PM
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet Ant Waters Microsoft Excel Programming 1 3rd Sep 2003 11:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:41 PM.