|
-
Feb 1st, 2006, 12:30 AM
#1
Thread Starter
Frenzied Member
VSTO 2005 - xml into Excel
How can I open an xml file into the existing workbook, and not open a new workbook? I have this code
Code:
Globals.ThisWorkbook.Application.Workbooks.OpenXML(
@"c:\temp\SportsFeed.xml",
System.Type.Missing,
XlXmlLoadOption.xlXmlLoadImportToList);
But it opens a new workbook, I'd really like the xml list to show up in the already open "Sheet1".
Thanks,
Mike
-
Feb 1st, 2006, 12:57 AM
#2
Re: VSTO 2005 - xml into Excel
That is the default action of the .OpenXML function. How about opening it hidden and then .Copy the Sheet over to your desired Workbook?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 1st, 2006, 09:19 AM
#3
Thread Starter
Frenzied Member
Re: VSTO 2005 - xml into Excel
That would probably work for me. I'm not that familiar with office programming, and don't see how to open it hidden - it's not an option for .OpenXml is it? Could you point me to a link or something that shows how to do this?
Thanks,
Mike
-
Feb 1st, 2006, 09:35 AM
#4
Re: VSTO 2005 - xml into Excel
If you want to load the data from a XML file into an existing workbook, rather than creating a new one, you should use the XmlImport method of the existing workbook.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Feb 1st, 2006, 10:27 AM
#5
Thread Starter
Frenzied Member
Re: VSTO 2005 - xml into Excel
That looks promising too, but I'm struggling. Reason is, the xml I'm given does not have a schema, and XmlImport requires one.
Maybe I should rephrase my question. I have some xml, either in a file or as a string in memory. I'd like to put that xml in Sheet1 at A1 and have it show as an xml list.
Thanks again,
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|