Re: Using Workbook.XMLImport
- From: Cindy M. <C.Meister-C@xxxxxxxxxx>
- Date: Mon, 16 Oct 2006 11:58:16 +0200
Hi Gary,
Regarding your response to the "running a macro" topic. I have been able toIt's simple enough in execution: Tools/Digital Signature. The bigger question is
get that running, but it has some drawbacks in that when used on another
machine, the macro requires either the user reduce their security setting or
the macro author (me) sign the macro. To this point, I have just had the
user reduce their security setting, simply because I do not have experience
with signing macros. In addition, the macro I constructed for the
Proof-Of-Concept has a hard coded filename as the XML source - something
that must eventually be programatically set (I will need to work on this
some more, if I find the macro approach as my choice).
Questions:
Any ideas on how involved macro signing is? How about techniques of
changing the hard-coded XML filename?
obtaining a certificate. If your company has Windows Server 2003 it can generate
certificates for company use, no problems. It's also possible for you to use
selfcert.exe to create certificates and use them on other machines. You just need to
realize this isn't "secure". The other option is to purchase a certificate from a
company such as Verisign or Thawte.
As for my perferred approach of using the ThisWorkbook object inside aI'd need to find some time to test, Excel isn't my primary application... (Post a
managed code base (C#). I do get the intellesense menu showing the
XMLImport method for the ThisWorkbook object. My problem is figuring out
how to construct the parameters in the method. I have made enough progress
to figure out what type the parameters are supposed to be (wow!), and think
my problem lies in the consstruction and use of the Excel.XmlMap object. I
have my code and the error message generated listed below this post.
Question:
Any ideas on how I can get the XmlMap method to work?
reply to this to keep it on my radar, I may find some time later this week if you're
still struggling)
The article link in my previous post, even though it is for VS2005, showsI can't imagine this should be necessary...
several code statements performing interop unwrapping and all kinds of
convoluted / complicated stuff.
Late breaking discovery:////////////////////////////////////////////////////////////////////////////////////
The first parameter, a string, I think should contain the XML string - tags
etc. I will have to brush up on my stream construction (I have always had
some problems with streams).
Questions
Any suggestions on how this approach may turn out? How about a head start
on constructing the stream?
////////////////////////////////////////////////////////////////
Excel.XmlMap myMap = ThisWorkbook.XmlMaps.Add (myInputDS.GetXmlSchema(),////////////////////////////////////////////////////////////////////////////////////
ThisWorkbook.XmlImportXml (
@"C:\myDir\SAMPLE1.XML",
out myMap,
true,
ThisWorkbook.Sheets[1]);
////////////////////////////////////////////////////////////////
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :-)
.
- References:
- Using Workbook.XMLImport
- From: Gary Rynearson
- Re: Using Workbook.XMLImport
- From: Cindy M .
- Re: Using Workbook.XMLImport
- From: Gary Rynearson
- Using Workbook.XMLImport
- Prev by Date: Excel asks, if you want to re-open the sheet again at startup
- Next by Date: Re: Smart Tag Recognizer for Office 2007
- Previous by thread: Re: Using Workbook.XMLImport
- Next by thread: Re: Cannot locate download for VSTO 2003, or for VSTO 2005 w/o 2007 (~
- Index(es):
Relevant Pages
|