How can I programmatically map XML fields in Excel 2013? - excel

I'm trying to programmatically map some fields from an XML file to a table in excel.
Manually, I go to the developer tab, hit the source button, select XML Maps, press the add button, paste in the path to my XML file, and Excel creates the XML map. I then click and drag the fields to certain cells in my worksheet. This works fine.
I figured I could use the macro recorder to capture this, however the actual mapping of the fields to the cells does not get recorded. The only thing that gets recorded is the creation of the map:
ActiveWorkbook.XmlMaps.Add( _
"path_to_my_XML_file" _
, "feed").Name = "feed_Map"
how can I programmatically map the fields to a range? Is it possible in VBA?

Related

Get values of dropdown from Excel file

i'm new to VBA and i try to create a word document where the content of the document is shown based on the selection of two combo boxes.
i have an excel file with 3 columns, server, version and content
i want to fill one combo box with all the content of the column server and one with the content of version.
based on the selection underneath the content should be shown.
is there any way to achieve this or maybe do i need to change to a different solution?

Save filter view Excel 365

I have a huge Excel spreadsheet (36 columns) and applied filters on the header row. I made some configuration and now I have the filtered sheet.
Is it possible to save this filter configuration?
There was the option back in MS2007 (Custom views) but I cant find it in Excel 365.
In the "View" ribbon select "Custom Views" in the group "Workbook Views". If it does not appear go to options->customize ribbon-> select all commands-> find "Custom Views"-> add to a custom ribbon.
After filtering your table, click on "Custom Views" -> Add
This will save the table filtering among other things.
Keep in mind that Custom Views are worksheet-specific, meaning that a custom view only applies to the worksheet that was active when you created the custom view.
You can create a macro that will apply the filters to the table.
Developer Tab
Record Macro
Apply filters to table (you can even just edit the filter for each column and select "OK" to apply the filter you already have in place)
Stop recording Macro
From then on you can just run the macro you recorded and it will filter your table.

protect data validation list content in protected excel speadsheet

I have a excel spreadsheet which I want to protect. There is a data validation list that use INDIRECT formula to display values from a table. I want the user to be able to select values from that list, but I don't want the user to be able to remove the text displayed in the cell. Can that be done without VBA?
Yes. If i understand you correctly you ensure that you have unchecked the locked box for the cells containing the data validation. Right click format cells -> protection -> uncheck box Locked. And when setting up your data validation ensure you uncheck the Ignore blank box. Then when sheet is protected user can only select from drop down list. They can't delete what is in the cell.

Sharepoint 2010 Content types Hyperlinks and Word QuickParts

Sharepoint 2010I'm slowly making progress with Sharepoint, but have encountered a problem with Content Types and Word Quickparts.
What I'm trying to do:
I want a Content type to hold summary information for manuals and related documents that might be located in separate libraries. I want to display this information in a Table within Word (by setting up a template) using Word Quick Parts>Document property fields.This table would then summarise all the relevant fields and their related links at the top of a document that in turn summarises information about a particular system.This Word document in turn would be stored in a separate document library.
This all works fine for dates, text descriptions, check boxes, yes/no fields and drop down selections as I can find the related Word Quick Parts>Document Property
However, the "Hyperlink or Picture" Type fields are not present in the Word Quick Parts>Document Property fields. SoAm I completely misunderstanding what content types are for? orIs there a setting within sharepoint that would make these hyperlinks visible in the Word Quick Parts?or Is there a better alternate solution. Thanks!
Hyperlink is not available as property in Word Quick Parts.
Sadly, you can access to this field in Word when you click in the property icon. This will display all the SharePoint property of the document with the hyperlink field.
A workaround would be to create a simple text field and to put the URL of the hyperlink field in this field. (With Workflow or Event Receiver)
An another deep solution is proposed in this link :
https://social.msdn.microsoft.com/Forums/office/en-US/c7619237-baa1-4669-af65-0f0a39223aad/sharepoint-metadata-and-office-quickparts-hyperlinks-are-not-appearing-in-the-quick-part-list?forum=worddev
This is about create two properties, one for the text, one for the url. Then to arrange it in Word in order to get an hyperlink.
Since Microsoft seems to be removing a lot of its legacy web pages, the content of the above link is copied below:
a. In the sharepoint list, you will need two text properties, one for
the link text and one for the display text. Let's call them hllink1
and hldisplay1. For a sample document, put some text in each of these
properties.
b. in the template,
insert the hllink1 Document Property and the hldisplay1 Document Property. This is a temporary move that will let you change thevalues
of these properties without displaying the DIP
insert a HYPERLINK field as follows
use ctrl-F9 to insert a pair of field code braces { }
type HYPERLINK "" between the {}, so you have
{ HYPERLINK "" }
then insert another copy of the hllink1 Document Property between the ""
{ HYPERLINK "the Document Property for hllink1" }
c. select the Hyperlink field and use F9 to update it. When you show
the result (Alt-F9), you should see a clickable hyperlink where the
"display text" is the same as the link text
d. Click somewhere inside the display text, and insert the hldisplay1
Document Property.
e. Carefully select the remainder of the display text and delete it.
You should stil be left with a hyperlink that can be ctrl-clicked in
the usual way.
f. Modify the texts in hllink1 and hldisplay1. However notice that,
as a maximum, the hyperlink display text will update automatically.
The tooltip for the hyperlink does not update automatically.
g. Select the hyperlink and press F9 to update it. The tooltip/link
text should update

Extract items from pulldown menu in Excel

I want to extract the contents of a pulldown menu in excel. These are the attributes from Amazon offers sellers to list an item.
https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/btg/electronics_browse_tree_guide.xls
The problem is that data fields are grayed out & even after I unlock the spreadsheet I can't seem to get access to the part that stores the lists. Can I extract the contents using any software?
I'm assuming you're referring to the drop down in the Refinements sheet.
These values are being populated from a hidden sheet called DB. Just right click on any of the bottom tabs and select "Unhide."
You can also do this through the VBE (Alt + F11), selecting the sheet and then changing the "Visible" drop down.

Resources