Nature of Excel 2010 VBA Embedded Chart Container - vba

I searched Google and on many different forums but cannot find the Physical Nature (I don't know to say it) of an Embedded Chart's container window, I mean the canvas like rectangular area which serves as, well, the chart container.
I know that it is a ChartObject.
The main clarifications that I needed is:
Is it a Shape as in Autoshape or Freeform shape? (I suspect so)
It does show up as a shape in Selection Pane.
Copy/Pasting Freeform shapes onto it causes pasted shapes to stick onto it while doing the same with any other two shapes won't stick to each other.
Is it a Userform? (I am skeptical)
But Userforms are always in front of the shapes and shapes cannot be pasted onto userforms obviously.

The ChartObject is also a Shape that can be reached via the Shapes collection.
?Sheet1.Shapes("Chart 1").Type = msoShapeType.msoChart
True

Related

Set One Slide Size/Orientation Without Changing Whole Presentation in PowerPoint using VBA [duplicate]

Making a powerpoint that's supposed to show a before and after of a website. Since it's currently a long website I'd rather make a single long slide to put it on (20" instead of 7.5"). But all the other slides in the presentation should be normal-sized.
I found Slide Size (Design ribbon, Customize section) but that resizes ALL slides.
You can't. You can only have one slide size and one orientation per presentation.
Are you projecting the presentation or delivering it on a laptop?
If so, the size is sort of irrelevant.
Regardless of the slide size, the projected/displayed image will never be longer or wider than the projector/display accepts.
Although you cannot use different sized slides in one PowerPoint file, for the actual presentation you can link several different files together to create a presentation that has different slide sizes.
The process to do so is as follows:
Create the two Powerpoints (with your desired slide dimensions)
They need to be properly filled in to have linkable objects and selectable slides
Select an object in the main PowerPoint to act as the hyperlink
Go to "Insert -> Links -> Action"
Select either the "Mouse Click" or the "Mouse Over" tab
Select "Hyperlink to:" and in the drop down menu choose "other PowerPoint Presentation"
Select the slide that you want to link to.
Any slide that isn't empty should appear in the "Hyperlink to Slide" dialog box
Repeat the Process in the second Presentation to link back to your main presentation
Reference to Office Support Page where this solution was first posted.
https://support.office.com/en-us/article/can-i-use-portrait-and-landscape-slide-orientation-in-the-same-presentation-d8c21781-1fb6-4406-bcd6-25cfac37b5d6?ocmsassetID=HA010099556&CorrelationId=1ac4e97f-bfe6-47b1-bab6-5783e78d126d&ui=en-US&rs=en-US&ad=US
True you can't have different sized slides. NOT true the size of you slide doesn't matter. It will size it to your resolution, but you can click on the magnifying icon(at least on PP 2013) and you can then scroll in all directions of your slide in original resolution.
if you want to shrink one slide for instance, add shapes to hide the unwanted background margins. you can set the shape color filling as the background (gray or black).
It's "ugly" but it works
true, this option is not available in any version of MS ppt.Now the solution is that You put your different sized slide in other file and put a hyperlink in first file.

Excel vba drawing text,lines and polygons on imageor shape object then saving as bitmap or png file

I'm in an excel vba program and I need to display and create a label for a printer.
Now this printer (Zebra Z4M Plus 300 dpi) is extremely fussy and hard to use.
I can now print to it if I create an image file (png or img) of dimensions 944x406 and put my desired label in an area of 797x396 in the upper left corner of that image file.
My question is about creating said image.
Some 10 years ago I remember that it was possible (in probably vb6) to use image primitives such as lines, polygons, circles and text to a picturebox control.
In Excel I have created a form and created an image control however a look at the functions and properties of this object didn't reveal any function for drawing anything on it !
(P.S. I have now found that this image object has a .picture property, this property has a .handle property and .render function, I must be close to something usable but I can't find it. It seems I could load a picture from a picture file using the LoadPicture function on this picture property)
(Perhaps there are windows api function that will let me draw on this .picture using the .picture.handle ?)
The excel Shape object also didn't have drawing primitives but it did have a .CopyPicture function that would allow me to put the contained image in the clipboard (and then I just need to find a way to save the clipboard content to an image file)
If possible I would like to draw to an object which is contained in the worksheet rather than in a userform.
I am looking for further search keywords, names of objects and function for drawing.
Thank you !

Using the Form Scrollbar to Control Image Transparency in Excel VBA

I'm struggling in making a form scrollbar to control the image transparency. To be specific, I've got two images that I'm linking to two buttons. Hide/show buttons, and I want the scrollbar to control the image transparency as shown in the image below. Your help would be appreciated. I can't wrap my head around to code it.
Here is a low-tech approach.
1) Create a rectangle and fill it with your picture. This doesn't require any VBA.
2) Insert the scrollbar and, using the properties, link your scrollbar to a cell with the default 0-100 range of the scrollbar's values. For example, in the following picture I linked it to J20:
Then, in a standard code module put:
Sub SetTransparency()
Sheets(1).Shapes("Rectangle 1").Fill.Transparency = Sheets(1).Range("J20") / 100
End Sub
(With of course things like Sheets(1), "Rectangle 1" and "J20" to be adjusted to match your situation)
Then - all you have to do is right click on the control and select Assign Macro to assign this macro to your control. It can be used like:
Possibly unfortunately (depending on your desires) the transparency doesn't change continuously as you scroll. AKAIK, you would need to use Active-X controls for that.

Modify Z-index on Series object in Excel 2010

I am using excel 2010.
I have a chart diagram on which i put a rectangle to surround the highest column bar.
In order to make things more readable, i would like to place this rectangle on the chart but NOT in front of the lines/bars/etc...It has to be behind them.
Shape objects (like my rectangle) have a ZIndex property than can be modified in order to achieve that. Thing is, it seems impossible to put that behind the elements of my chart, nor the chart itself.
The main reason is because Chart objects and Series objects (which are the columns inside my chart) doesn't have a Z-Index property.
Is there a way which could allow me to achieve this ? Other than modifying ZIndex property ?
You can move the Chart in front of the Shape, or the Shape in front of the Chart. But what you are looking to do is to stuff the Shape behind some components of the chart, but still in front of the chart background.
That, as far as I know cannot be done.
But you can simulate the effect by making the Chart's background and the Plot area transparent (no fill, instead of the default White fill) by simply right clicking and adjusting properties.
Also, you can highlight both the chart and the shape (Ctrl-Multiple Select) and lock the two together so your Shape will look like it's a part of the chart and is behind the components.
Of course, the shape will be behind the whole chart itself (by setting the appropriate Z-value, which you may find by simply clicking on Record Macro and running the formatting once to get sample code) but since the chart's background is transparent and so is the plot area's it'll look as if the rectangle's behind the lines and all.

Copying shapes between PowerPoint 2007 presentations along with their animations

I programmatically copy the shapes of an entire slide to a new slide in another presentation by performing origShape.Copy and then newSlide.Shapes.Paste().
(copy/paste the entire slide is unfortunately not an option for me here)
My problem is that Animation effects get really warped. Some are lost, others appear in the wrong order.
I thought that maybe after copying all the shapes I'll go over origSlide.TimeLine and will copy each animation effect to newSlide.TimeLine with the corresponding Shapes.
Is there a way of copying Animation effects between shapes without manually setting each and every parameter? (there are LOTS of these).
When copying shape-by-shape to a new slide, naturally the order of the animations gets ruined.
If we had for example the following animation sequence:
Rectangle flying in
Triangle flying in
Rectangle flying out
And we copy first the Rectangle and then the Triangle to a new slide, we'll get first both animations of the rectangle and then of the triangle.
My mistake was trying to solve this disorder by using Shape.AnimationSettings.
BEWARE OF SHAPE.ANIMATIONSETTINGS!!
This Property is kept only for backward compatibility with old versions of PowerPoint. If you modify any of its fields, all animations of a shape except the first one get AUTOMATICALLY ERASED !
So, the solution is this:
Copy shape by shape to new slide (no animations are lost, just mis-ordered). Then use Slide.TimeLine to go over the animation Effects and order them correctly using Effect.MoveTo, or Sequence.Clone and Effect.Delete.