Microsoft Excel Formula - excel

Can some one recommend a reference for learning Excel for a programming minded person. I am looking for a less ummm squishy reference then the ones presented by a web search. All I could find was information for mouse monkeys.
I am looking for a syntax and function reference and information about using VBA. I also would appreciate a link to learning access for some one who knows SQL.

Run Excel.
Press Alt-F11. (VBA editor opens).
Press F1. (VBA help opens)
Choose Excel VBA reference.
(And for the Access part of your question: I would suggest almost the same: have a look into Microsoft's original VBA docs which come together with the product, they are definitely for programmers, not for "mouse monkeys").

Related

Conditional formatting of a shape in Excel Online

I'm trying to add an arrow to my Excel online document, that changes colour dependent on another cell being positive or negative. In Excel desktop this is easy, but is it possible in the online version?
You can't use macros (to the best of my knowledge), so VBA is out. CF add in's don't work, and you can't use linked pictures.
Any help would be greatly appreciated

Evaluate a formula in Excel Online only once at file opening?

I had a VB script function Sub Workbook_Open() that was copying a value from one cell (a total from previous day) to another cell at file opening. Now I would like to put my Excel sheet online (MS Excel Online) where execution of VB scripts is not supported so I am trying to realise the same functionality with a formula like =FUNCTION().
Is it possible and how to evaluate a formula only once each time at file opening in MS Excel Online (without using VB script)?
While you cannot use VBA in Excel Online, you may be able to use Office Scripts.
This new scripting technology is currently in preview and it also needs to be enabled by your tenant administrator.
https://learn.microsoft.com/en-us/office/dev/scripts/overview/excel
If you don't yet have access to Office Scripts, I'm afraid there is no solution for what you describe.
Unfortunately the Online MS Office Scripting is not yet a reality as you can see on this link. Hopefully Microsoft have mercy on us one day and allow us to have this crucial feature for some of our most important workbooks. In the meantime, we shall be using this feature only offline.

Is it possible to put a custom GUI on top of an Excel spreadsheet?

A friend of mine has a very complex Excel spreadsheet with many formulas and lots of data that he uses for work. He wants to put a custom GUI on top of it and then wants to sell it to other people in his profession. Basically he wants to make some freestanding software out of his spreadsheet? Is there any way to put a custom GUI on top of an Excel spread sheet? The spreadsheet would just reside in the backend and be a kind of database and do the calculations necessary. I know this is definitely not an elegant solution but I told him I'd look into it. Any ideas?
I use Clear Office.
You can host workbooks in your GUI, host GUI in your workbook. All .NET, no interop.
Excel Interop fits the bill. Code your GUI with WinForms/WPF and .NET; invoke excel in the background to be your calculation engine. Pretty ugly (and probably slow) solution, though.
Check out the book Professional Excel Development by Bovey. It talks about how to do some radical Excel customizations along the lines of what you are suggesting.
Depending on how complex the application/input is, he may be able to use userforms, which are built in to Excel. Alternately, he can set up a sheet as in input form, and use other sheets for data/calculations, and super-hide them. We made a spreadsheet for a company at work, and used both solutions. Userforms can be frustratingly inflexible, but they work.
You can also add in some VBA to show the Userform when the workbook is opened, although if macros are disabled (which they are by default) then it won't work.

Excel picture tools format vba

In excel & word 2007 there is a picture tools tab that shows up in the ribbon when you insert a picture or clip art and there is the smart art. Is there a way to manipulate these objects and settings (e.g. transparency, position, effects etc) in vba. A macro doesn't seem to work for me either.
I know that in Excel VBA (my experience is prior than 2007), you could manipulate many aspects of images via the Shape object. A good way to explore the Shape object is to record a macro while you try to manipulate the image and then look at the VBA code it created to see what you did. This doesn't always work perfectly, but it's a great way to start.
Also, you might be interested in checking out the answer I gave to a related question about moving images between cells in Excel .
I'm not sure how many aspects of an image you can manipulate just with the Shape object, but it's worth taking a look.
For now I don't believe there is a way to manipulate with code these picture aspects in office 2007.
If anyone out there has a better answer, I will mark it as accepted.
This will help if you want to change the actual picture displayed. It's non-VAB stuff, but the technique is worth knowing about
here

Alternative to Excel's RefEdit control that can be used outside of VBA

The RefEdit control that comes as part of VBA is a little buggy, but it's good for putting on a form when you want people to specify one or more ranges of cells (i.e. Excel.Range objects).
The main problem is that you can only use the RefEdit control on a VBA UserForm (Microsoft states this, and my tests confirm it too). I'm making an Excel add-in using Delphi, and I'm looking for an alternative to the RefEdit control.
Excel.Application.InputBox Type:=8 is one alternative way of selecting a range of cells, but it's not very user-friendly when you need people to select multiple ranges of cells on a single form. The best real alternative I have at the moment is to call a VBA form from my Delphi add-in, but that's far from ideal.
So ideally I could do with a drop-in replacement for RefEdit - one that I can use on a Delphi form. If there is one, it's not easy to find (I've been searching pretty hard, and I've not been able to find a drop-in RefEdit replacement for Delphi, VB6, or .NET).
Failing a drop-in replacement I might try cobbling together my own alternative, but I suspect it would be difficult if not impossible to make one that works as well as RefEdit. RefEdit lets you "select" cells without actually selecting them: it uses marching ants around the cells that you choose instead of highlighting them and changing the Excel.Application.Selection. I don't know of a way to do that by manipulating the Excel object model through VBA, Delphi, or whatever.
Any tips, tricks, hacks, or, if I'm really lucky, pointers to drop-in RefEdit replacements would be most welcome.
I came across this RefEdit control replacement when looking for workarounds to RefEdit's bugs. A third party control wasn't an option for me at the time but it might help you out.
Not sure from your question: Have you tried to import RefEdit into Delphi?
You can import it as an ActiveX control from RefEdit.dll, then drop a TRefEdit control in any Delphi form. and you have the very same RefEdit as in your VBA apps.
Or is it what you tried and it does not work because RefEdit needs some VBA woodoo...?

Resources