I am considering implementing an Excel add-in using COM (not VBA) that will manipulate data in the worksheet.
I am going to need this add-in to seamlessly integrate with the Undo stack.
More specifically:
Any changes this add-in makes to the data need to be undoable by the user (through the standard Undo action)
The items on the Undo stack before the add-in action takes place need to be preserved
In my (albeit perfunctory) research so far, it is unclear whether or not Excel can allow for this. If it does not, this is a showstopper, and the add-in will have no value.
My question: is it possible? This is more of a "yes or no" question than a "how" question, as I need to know if I am embarking on a wild goose chase or not. However, any pointers on how it can be done would be a bonus.
Seems like it is not possible after all.
The Application.OnUndo method clears the current undo stack and places itself on top.
There doesn't seem to be anything else related to customizing undo.
It is possible.
Application.OnUndo registers an undo sub for the currently executing sub:
sub ImMakingChanges()
cells(1,1).interior.color = vbyellow
application.onundo "Undo the stupid color", "RemoveMyStupidChanges"
end sub
sub RemoveMyStupidChanges()
cells(1,1).interior.colorindex = xlnone
end sub
Obviously, saving a previous state in the wild is generally a nightmare. But here you go.
Also, your undo sub will need to be visible to the general public so that Excel can find and call it.
Apparently, this is not possible and there are no plans to support it even in Office 2013, as per the response by an MSFT employee on this thread.
Seems like it is possible after all
This can be done, but you'll have to write a pretty involved Undo handler.
Here's a link that well tell you exactly
how: http://www.jkp-ads.com/Articles/UndoWithVBA01.asp
Fortunatly the link has full sourcecode and it looks ironclad so you should have no problems.
I'll be happy to hear how/if this worked for you.
PS: here's the same link in Dutch: http://www.jkp-ads.com/Articles/UndoWithVBA01NL.asp
Related
Is there a way to protect or hide custom code written in X++ for AX customization. I have made some new custom Forms, Tables, ...etc, on AX and i would like to hide the source code of my customizatzaion.
It's not possible. You can only protect you code by using the correct layers.
You could always scramble/obfuscate your code, there are tools that do this like this one:
http://www.aximprove.co.uk/
However hiding your code or scrambling it is a bad idea. It goes agains everything AX stands for. When you create a product as an ISV, you partners have the right to extends that functionality for their customers. And when a customer wants to customize the solution that the partner provided, they also should be able to do that when they have the correct license. That would be impossible when the code is scrambled.
Also, imagine debugging that code...
No customer/partner should accept that a solution written in X++ is scrambled.
I do not believe this is possible. From whom are you trying to hide the code?
One solution to hide your code would be to completely remove the layer (.aod file) that you created your customizations on. However, this would take all of your modifications out of the application along with the code.
The only way to keep source code hidden from another user is to make sure that they do not have an X++ Source Code security license on their application.
Definitely you can't. The X++ code in Dynamics AX is open by definition and there is no way to obfuscate or lock the source code for users or another partners if they have a development license.
You have your code protected by layers, but it is impossible by definition to hide it.
No you can only obfuscate your code. If you want to keep functionality private, you can put code in a .NET assembly.
Like Klaas said, almost no customer would accept this. I personally wouldn't accept the code, and I work for a large customer. I need to be able to debug immediately. If your code causes an issue that stops our production, that's $150k/hour...that's why I'm on-site and available 24/7. I doubt you can provide that guarantee too.
Does TFS 2010 have the concept of checking out work items and checking them in. This action would lock the item for edit by other users while it is checked out.
I know I can do this for files under source control, but what about regular work items?
I haven't yet come across any documentation around this. If it's possible, does someone have a code sample?
That is not possible. In TFS11 we have added 'merge on save' so there are less conflicts when saving a work item.
Would love to know why you want this feature though.
You could achieve a lock mechanism on work items if you write a custom control that allows or denies saving based on the result of some query you make to a custom service.
You would want to create a visual studio plugin that sets and resets the lock per work item.
While you're at it, you could write a server plugin that persists a serialized copy if the work item to disk or to the version control system.
I know it's a lot if work, but it should give you what you asked for.
I am looking for a fancy way the print individual work items in TFS.
OK ... maybe not the work item directly but I need to produce printable forms based on data on a work item. And by fancy I mean: header, footer, formatting, tables maybe ... stuff like that.
No, I am not trying to print a list of work items, read carefully, I need an output based on a single work item.
For those who are wondering "Why on earth do you need that?" I should say:
We are keeping everything on TFS around here. (For now only software development stuff, but I am thinking bigger...) Sometimes somethings need to be on hard copy, to be signed for instance, and that is why I need printable forms.
I came up with a solution a little interesting from my point of view.
I used the "mail merge" function of MS Word to print work items. I prepared an SQL query that reads whatever fields are needed from TFS database and set the query as a datasource for mail marge.
Now I can design a word document of any kind and use TFS fields in the document. I just select the appropriate record by work item number and voila!! my printable work item is ready.
It is a little slow when selecting a work item if you use a query that returns all work items, but who is perfect? Right ?
Though I agree that Reporting Services is probably the best way to accomplish this, you could alternatively write a web application that queries TFS and formats the data into a nice, printable HTML page. If you really wanted to, you could even look at some of the PDF libraries that are out there and just form-fill a PDF.
Here is an other free tool which can print tfs workitems:
http://blog.bbv.ch/2013/10/31/tfs-print/
You can use the Reporting services to create nice reports.
Access to the reporting services.
http://[tfsservername]/reports
Use the report designer with the standard cube's.
Here a link to get you started
ALM Rangers recently posted a tool on CodePlex which is actually an add-in for MS Word. What it does is connect to a query on TFS and create a word documents based on a print template.
http://vsarword4tfs.codeplex.com/
I'm customizing work item templates in TFS 2008 through the PowerTools and I'm wondering is it possible to hide a field (or it's value) for certain users?
For example, let's say I open TFS to my clients so they can submit feature requests. I'd like them to see the work item created, to see the history, changes etc. but I'd like to keep some of the field private and for our internal use.
Is it possible?
Hm, it seems it is not possible YET.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254161
"This is a great suggestion. We have added it as a candidate for a future release. It would help us if you could provide a business case for this request. Thanks."
Another option would be to create a custom interface to the work items that only exposes the fields you want, while hiding others. While it would mean some custom development, it would solve the problem.
You can make it readonly - that's close? Good luck.
You can use the rule.
Simple question, spurred on by the removal of the target attribute in HTML 4.0 Strict and XHTML 1.0 Strict.
I personally don't think so, as web users become more savvy, they'll ask for a new window from the browser. It annoys me when a website does this a lot.
I think the question is sort of subjective. It could be good if you're launching a javascript game or something.
Here's Neil Turner's reasons not to do it.
On social content sites like Digg or reddit I prefer links to be opened in a new window/tab, as I am constantly going back to the original page to grab more links to look at.
That being said, I think that wherever you can you should allow a logged-in user to make the decision for themselves. I know Digg allows users to choose how they want links to behave.
I think this is pretty subjective, so I'll just give my opinion as a user. I prefer if it's just the default behavior. If I want it in a new tab, I'll middle-click.
If you're going to open it in a new window, warn me like this [new window] or something.
As a law, there is an exception to every law. Although in most cases simple links are best, sometimes links in a new window are just what is needed.
For example, I very much enjoy blogs and forums that open any external links in a new window, so I don't loose track of the original post I was reading.
Another good place to put them is when you click on a picture to get a larger version in an internet store or something.
You really have to evaluate this on a case-by-case basis, but my opinon is that in the end both are necessary for a good UI.
I do if it is an external link, other than that it is probably a bad idea.
The only time I force a new window is when the page I'm designing is ment to be used as a Web Part for a Sharepoint site.
I look at it this way, if you force a new window, you have taken choice away from the user. That's bad.
With two exceptions, the answer must be a resounding "no".
Rationale: Yes, as others have already pointed out there are many cases where I prefer to have a link opened in another tab. But thanks, I'll make the determination of when and which myself. The basic tenet of the web is that the user is sitting with a user agent, a.k.a. web browser. The browser is in other words an agent on behalf of the user. If I'll want a particular link opened in another tab, I'll command-click (or ctrl-clik on another OS), and if I don't, then I'll click regularly. When a link on a web page opens the link in a new tab without my asking, it annoys me no end and breaks the predictability and familiarity of the web.
Exception 1: When clicking to see a large version of a picture or some other plain pop-up window. I see this as a separate topic.
Exception 2: Fully Ajaxy web applications, which seem to set aside most of the rules of the web anyway.
Yes, in web apps it sometimes makes sense to use a popup window when pulling up something ancillary that you need to look at without losing the content on the page.
For instance, I have used popups to display reports. In those cases (which are situational), users needed to look at the report and the screen at the same time, not navigate away to a reporting interface.