How do I save an image as resource in Excel and reference it in Footer? - vba

I am trying to embed a logo in the footer of a dynamically generated spreadsheet.
My first thought was to see what "macro recorder" would provide. Unfortunately, it references an image on the user's computer. The problem is that, in most cases, this file will not exist, and I don't want the user to have to download an image for the VBA script to be functional.
Is it possible to store an image in a VBA-enabled spreadsheet as a resource and then reference it from the footer?

Related

word-vba: Unable to update linked image link

I have a document with two inlineshapes into a table on the document header. These inlineshapes are linked images. The folder containing these images has moved and I'm unable to change the image link by VBA code.
I'm working with Word 2016. The documents were created on Word 2003. The only way to access the images has been exploring the table cells and finding the inlineshapes into them
The inlineshapes have no field object defined (nothing)
I can update the link manually going into the File menu > Edit File Links...
I would like to be able to change the image links with vba and not having to do it manually
Well, at last I found what happened.
The images have to be accessed as inlineshapes, not as fields
the path to the image is stored in the property InlineShape.LinkFormat.SourceFullName
Changing this property value and then updating the inlineshape it worked
Sorry if I've bothered you but I think it can be helpful to other users

Update an existing PDF

I have an existing PDF template, and I want to add some text over the top of it in a specific location on a specific page. For example, an invoice template or a scanned document.
How would I go about this? I'm using Sheets if that narrows my options.
There is a lot of documentation on how to create PDFs from documents, but nothing that will take a particular PDF and put text over it.
A bit of blue sky thinking from my side. What if you were to do the following?
Manually:
Export the PDF as an image
Resize a Google slide to be the same shape as the image
Add the image to the google slide as a background image
In Code:
Make a copy of the google slide as needed
Add your Google sheets data to the slide positioned as needed on the slide
Export the Google slide as a pdf
I mention google slides, because Google docs to not have allow background images.
Another possibility with using Google docs is to build a document that looks like your invoice, then add to it tags. In your code search for the tags and replace them with data from your sheet. Even you could use a mail merge addon to do this if you didn't fancy writing any code.
In your Google Drive right-click on your PDF;
Open With > Connect More Apps > Search docusign > Left-click blue connect button and this should take you to Docusign.
Your PDF will then open with Docusign where you can manually add a signature or text to specific places.
Alternatively... You can use App Script.
Example,
Constructing a document using HTML and replacing the specific value with a variable which is collect from a Sheet or particular location. Writing the function to do this will allow you to interpret the HTML and replace the variable with the text or possibly an image. Then it would create this as a PDF.
There are many alternative ways to do this.
Here is one example on github;
Convert Google Doc to PDF using App Script

How to link an image to the header

I have an Excel sheet where I am using an image in the header. From this question I already know how to add or link images as Shapes in an Excel sheet.
Now I need to do something similar to the header, where I can link an Image to the header instead of saving the image in the Workbook (because I have a lot of images which makes the file size huge).
Code:
Sheet.PageSetup.LeftHeaderPicture.Filename
You need to set the Filename property of the _____HeaderPicture property to the path of the picture you want to use.

Placing a bitmap into a Powerpoint Add-In

All:
I am writing a PowerPoint add-in that will allow a user to drop specific safety related images onto a map. I've written the code that copies the images and places them on the slide and I would like to place it into an add-in. Unfortunately, I cannot find a way to either:
a) place the images into the add-in
b) reference images if I were able to place them in the add-in
The alternative approach is to require the user to start with a special template that includes all of the images and then load the add-in to get the menu functionality. I would much rather have a single file that contains both the code and bitmap images.
With best regards,
Walt
PPA files contain only code, not presentation content like images. As an alternative, you could distribute a PPT/PPTX that you open invisibly and extract the image you need.
After quite a bit of looking around I found a solution that resolves the problem adequately. Using Microsoft's Custom UI Editor, I created an XML entry in the PowerPoint Presentation that performs the Auto_Open function that would have been part of the Add-In. This allows me to add the menu functions that will be responsible for loading the specific images.
I've added a reference page at the beginning of the presentation that contains instructions on how to use the template... This page also contains all of the images that are used by the visual basic code. The 'Visible' flag on these images are set to False so the user does not see them. As they are copied from the reference page into the presentation, the Visible flag is set to True and they are pasted onto the current slide.
It is not a perfect solution, but it is adequate...

How do I hyperlink from a PDF file to a specific page in a PPT file

I have a PowerPoint 2010 file saved as a PowerPoint Macro-enabled show (.ppsm) file. I have a hyperlink on a particular page of the PPSM and I've linked it to a PDF file. Great, it all works.
Now I need to put a hyperlink in the PDF file that will jump me back to the specific page in the PPSM, but I can't seem to figure out how to do it. The information in another thread says to add "#15" (the page number) to the filename, but the link seems to put the entire file path. I also get an error that this is not a valid file name. I want to be able to just store the files together in the same directory and have them find each other with the file name, not the whole path.
All assistance gratefully accepted.
If you're running the slide show and link to a PDF file, the show is still running and sitting on the slide you linked from.
All you need to add to the PDF is a link that closes the PDF or possibly quits Acrobat/Reader altogether.
Open the PDF in Acrobat, add a link, choose Custom Link, click Next.
In Link Properties dialog box, go to the Actions tab
Select Action: Execute a menu item.
Click Add to get a list of available menu items, choose File, Close
or File, Exit.
If you need to return to some other page than the one you started on in PPT, it gets a bit trickier.