How to reset sorcedata of ExcelPivotTable in EPPlus - epplus

I want to reset sorcedata of ExcelPivotTable,but EPPLus only provide ExcelPivotTable.PivotTables.Add(). How to reset sorcedata?

Related

Can't change value of empty PDF form field from VBA

I'm trying to automate populating a PDF form from MS Access VBA. The form itself is maintained online and so my process is:
Download the form
Open it in Adobe
Auto-populate fields
Save / send it on to others
All of this I'm doing from Access VBA. I've encountered an issue on step 3, however.
What I noticed was, if I try to populate the field from VBA, it works fine if the field already has a value. However, on a new / blank form, it generates an error.
Specifically, I call it using the document Javascript object (jso) thusly:
jso.xfa.resolveNode("form." & jso.getNthFieldName(0)).rawValue = 'test'
If the form field is not populated, VBA errors, saying the object doesn't have the rawValue property.
I'm guessing some sort of model initialization is forestalled until the form is populated at least once. The field reference exists in the jso.xfa model, but the property itself is otherwise inaccessible.
Is there a way around this other than pre-populating a "dummy" form? I'd rather not have to maintain / update it as the original gets changed online.

How do I save selected objects as a variable and recall that selection in PowerPoint using VBA?

I am trying to build a macro that allows the user to select a few ojbects in PowerPoint, name that selection, then at a later stage pick a name to reselect those objects.
I am stuck at saving the current selection as a variable, and saving that variable as part of the PPT, so that when a user opens the file again those selections are still availible.
I've tried declaring a variable of the Selection type, and setting its value to the active selection. But this gives an error.
You can't save a selection as such, but you can tag the selected shapes when the user opts to save the current selection, then when the user chooses to re-select that particular selection, look at each shape on the slide and if it has the appropriate tag, add it to the selection.
I have a free add-in that does pretty much what you're after:
https://pptools.com/free/FAQ00003-Selection-Manager.htm

Dirty on command?

I have an Access 2010 application that has a form with a text box and a command button on it. Clicking the command button places a default value in the text box.
Question: When a user clicks the command button I can either:
Run an SQL update to save the new text box value in the data source that it is bound to plus set the me.textbox1.value to its new value, or
Run the same SQL update to save the new text box value in the data source that it is bound to plus do a form.requery?
Which is better? Would changing the bound value in the data source initiate a current event and an automatic requery?
Thanks in advance.
If you want to save the entry immediately, I would write the value to the text box, and do
Me.Dirty = False
to save the record in the bound form.
I see no point in doing this via SQL.
Would changing the bound value in the data source initiate a current event and an automatic requery?
No, that would actually be the worst method. The form wouldn't know about the changed data source, and once the user would start editing, he would get the "Write Conflict" message.
Your 1. would have the same problem.

Upadate text in text box using Microsoft Visual Studio 2010

i want to set text as default on text box and it will be update for each starting after that using vb.net 2010. as example, i need to process out progress for a stock.the default value of stock is 30, so at the first log in, value text box will show 30 as the number, user will run out process (default number - out number = result), result will be show. then if user login for next time, it will update the number as result number at the first process.
Use the (ApplicationSettings) node in the Properties window to create a setting and bind it to the Text property of the TextBox. That way, value in the control will be saved to the user config file at shutdown and loaded at startup automatically.

Storing a hidden, non-editable variable in a form. Word 97 Compatible

I need a non-editable field in a word form that can be read in vba.
Currently I use a text field, which is hidden. As in:
ActiveDocument.FormFields("DocID").Select
Selection.Font.Hidden = false
//do read then re-hide it.
However users can still 'tab' in to this text field and overwrite the document ID that is there and thus invalidate the vba macro. And unfortunately that is what happens.
I can set the text field property 'Fill-in enabled' to false which gives the desired effect in the form, i.e the user cannot edit it. However now this text field cannot be read in vba.
ActiveDocument.FormFields("DocID").SomeProperty
//throws error 'The requested member of the collection does not exist'
So my question is, is there a way I can store a hidden variable in a word form that can be read in a vba macro?
Unfortunately this has to be a Word-97 compatible solution.
You could use custom document properties instead, see here:
http://msdn.microsoft.com/en-us/library/aa537154(v=office.11).aspx