I have created a huge application in VBA running powerpoint 2007 and I would like to convert it into .exe file . Any idea how could I do it?
You can fairly easily convert VBA to VB (classic, not .NET) and from there compile to an EXE. It won't be a standalone EXE, in that it'd require the VB runtime files, but they're installed as part of all normal Windows versions through 8 at least. Not sure of 10.
You'd start with code to launch PPT (visible or not) and get a reference to the PPT application object. From that point, most of your code conversion would be a matter of putting what you have inside a With oPPTApplictionObject/End With context and DIMming any PPT constants in your own code.
This would allow you to "drive" PowerPoint from an EXE rather than from VBA; obviously, PowerPoint would need to be installed. If you want to convert PPT VBA into a standalone program that doesn't require PowerPoint ... good luck. You're then talking about rewriting PowerPoint. May Baud have mercy upon your soul. ;-)
Related
I am writing a VBS script which copies chosen pictures from the folder where the script is placed to newly created PowerPoint document, adds some comments to each slide and saves the document in the same directory. The problem that I'm facing is a size of .pptx file which very often exceeds 500MB.
PowerPoint (2013) has built-in option to "Discard editing data" in Advanced Option menu which lowers the resolution of all images in the document to wish value (220 ppi in my case).
Is there an option to access related checkbox with VBSript? I was searching hard to find information how to enable this option via scripting but haven't found anything useful.
I would be much grateful for your help!
This isn't something that's accessible via the PPT object model, but since you're using VBS and not VBA from within PPT, you can probably make a few registry settings before launching PowerPoint.
To work out the needed settings, open REGEDIT and navigate to
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\PowerPoint\Options
Note: 15.0 is the version to use for PPT 2013. PPT 2016 is 16.0, 2010 is 14.0 and so on, skipping 13.0
Leave REGEDIT open while you change the PPT settings you're after; after each change, switch to REGEDIT and hit F5 to refresh. Any settings that change or are newly added are the ones you're after.
To get you started, the setting for automatically compressing pictures is a DWORD:
AutomaticPictureCompressionDefault
I have the PowerPoint presentation with VBA. I'm saving this presentation as .pptm or .ppsm file, and on my local computer it work great. But when i'm upload this presentation at OneDrive, the VBA doesn't work.
Please help me to understand why it happens?
Microsoft does not support the execution of macros in any Office application while stored on their servers. In addition, ActiveX controls may be removed so whilst you can upload a macro-enabled file and download it in order to run the code, ActiveX controls no longer be available.
References:
https://support.office.com/en-us/article/Work-with-macros-in-Excel-Online-98784ad0-898c-43aa-a1da-4f0fb5014343
http://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_windows8/macro-disabled-after-download-from-onedrive/922006f2-6ddb-4252-a193-c3e2a58fb688
I have a Word macro that has been working fine for ages. I have recently upgraded to Word 2013 and the behavior has changed.
It occurs on the following line:
Doc.SaveAs Path + "Manual\" + TitleString + ".htm", wdFormatFilteredHTML
which builds a valid file path and name and saves the current document as an HTML page.
Under Word 2013, the macro opens a file save dialog box with no filename and with the default file extension (.docx) instead of (.htm), as if the filtered HTML mode was no more available.
I have tried with named arguments, and also with the new SaveAs2 method, but saw no change.
How can I solve this ?
I fond this comment on the DataZX.CN forum:"I Had the same problem. I'm running a windows 8/64bits on an ACER laptop. SOLUTION : remove the Add-in "Icloud Acer ...".
I happen to use Acer desktop, and there was indeed this Icloud add-in pre-installed in Word. After disabling it, the macro works !!!!!!!!!!!!!!!
Thanks StackOverflow for pointing me in the right direction as always...
and thanks Yves for spreading the info...
I removed Acer cloud plugin from Word and excel just to be on safe side.
Blame foolish manufacturers like Acer for another bundled piece of crap software that causes more harm than good.
Quoted from MSDN forum post...
http://social.msdn.microsoft.com/Forums/office/en-US/59c0da80-a7e6-4026-855c-f6b9fbf9c386/word-2013-vba-documentsaveas-dialog-appears-even-applicationclassdisplayalerts-?forum=worddev
...From all you tell me, my feeling is that there may be another third-party application (or a virus) mixing in - that the display of SaveAs is not coming from your application.
This is difficult for you to test, since whatever it is is probably loading with Word...
I'm very new with VBA Excel and i only know the things as far as i need for this report formatting task. My code is almost completed, but what i wonder is, how can i make my program work on several documents?
I mean, i want to choose an excel file via my program, then i want to start the process of report formatting. Then maybe user need to format another document, i want my program to be able to format that document too. how can i achieve that?
Thanks in Advance
Timur
The way I am currently doing this is by creating an Excel add-in. To do this, place your macros and forms into a new, empty Excel workbook and save as a .xlam document.
To use the macros, open the your Excel file and the add-in. To open the add-in automatically, save it to "C:\Program Files\Microsoft Office\Office12\XLSTART" (Vista).
You can even create a custom ribbon for your add-in using the Custom UI Editor for Microsoft Office http://msdn.microsoft.com/en-us/library/office/ee691832(v=office.14).aspx (The download link is at the end of the instructions)
How can you make the .xla file if you want to create your own xla? I have the code, classes, shapes, etc....what is the process to making an xla file to point to? I know that I have to put it in my program files folder, and then go through the steps to adding an "add-in" in xls...but i mean actually saving an xla file to point to....
can i simply write all this in xls and then save it as file type xla?? because i have tried to do that but I get an error that it is not a valid add in when I am in a spreadsheet trying to point to it?
thanks!
This should help:
Create an .XLA file
http://www.vbaexpress.com/forum/archive/index.php/t-496.html
http://www.xtremevbtalk.com/archive/index.php/t-62362.html
http://www.ehow.com/how_5066365_create-excel-xla-addin.html
Creating An XLA Add-In For Excel
http://www.cpearson.com/excel/CreateAddIn.aspx
Microsoft Excel VBA Macros. How to Create an Excel Add-in For Them
http://www.ozgrid.com/VBA/excel-add-in-create.htm
Excel VBA - install an Excel Add-in (XLA or XLL)
http://vbadud.blogspot.com/2007/06/excel-vba-install-excel-add-in-xla-or.html
If you are still having issues let me know...