Merge multiple access reports to one pdf file using vba - ms-access

I wan't to merge multiple access reports to one pdf file using vba code. This vba code needs to work on the computers at my work. These computers only contain Adobe Reader, and I am not able to install Acrobat because I am not Administrator. So now my code generates for all the reports a seperate pdf. I had some code to merge these pdf files to one pdf file where I use 'Acrobat.CAcroApp'. But i get an error on line:
Set AcroApp = CreateObject("AcroExch.App")
I think I am not able to do this cause the computers only have Adobe Reader installed. Is there a possibility to create one pdf file for multiple reports/pdfs without using Acrobat.
Thx in advance

2 solutions.
Make a master report that has each individual report embedded as a sub report. If it's just a few, it should work fine, but too many may bog down / crash the application.
Here's a VBA way of doing it here.

Without acrobat reader this is indeed not going to work. I, however, am using the following dirty workaround for users without acrobat;
Export all your reports to rich text ("*.RTF" format) in the same folder. Afterwards, you open a word application via access vba, and loop through the RTF files and then copy them into your word file, with a page break after every insert. Then, you save the word document as a .PDF file.
This is a method prone to errors, so if a more experienced user has a better way, please do tell. I'm interested as well!

Related

How to modify Access DB File which is in sharepoint Document Library

I am having accdb file(Ms access DB file) in sharepoint Document Library. I want edit the file in browser or without downloading the file to the local.
I am able to view the file but not able to Edit it.
Need help
Access doesn’t really work this way. You can store the data tables in Sharepoint, but you still need the local access file to interact with it. You can link to data tables in Sharepoint. Instead of creating a brand new table, you import the data source.
Microsoft does have a newish program out now called PowerApps that may help you accomplish something closer to what you’re describing.

How can I use VBA code to convert a .html file to an existing .xlsm file?

I have software that generates a 2x 25,000 table of numbers in an .html format. My current process is opening the .html, saving as Excel workbook, etc.
The goal is to automate the process, import the data to Excel, and generate graphs and box charts. I have used macros to accomplish the latter but I am struggling with getting the .html data into the existing .xlsm.
I have found this code, from a helpful thread on Stack Overflow:
Sub Open_HTML_Save_XLSX()
Workbooks.Open Filename:="C:\Temp\Example.html"
ActiveWorkbook.SaveAs "C:\Temp\Example.xlsx", xlOpenXMLWorkbook
End Sub
However, I'm not sure how to use it. I've been using custom made keyboard shortcuts to access my macros such as Ctrl+Shift+Q. I also don't know how to edit it to suit .xlsm.

Automatically format .csv file upon download?

I have a form that will open a file based on user's selections. A few files are .csv and those files open up in Excel, as expected. However, everything is placed into one cell... I know that there is a way to manually configure it so that the | or , are delimiters, but is there a way to set it so that Excel will automatically set the | as a delimiter?
Thank you in advance!
Because you use the word "download" and your question is tagged "html", I assume that the user interacts with a web form rather than a desktop form.
In that case, it's the web browser that decides what to do with the file. If the browser recognizes the content-type of the response as something it can handle natively (e.g. "text/plain" or "image/jpeg") then it may open the file and display it directly.
However if the content-type is not something it knows how to deal with (which is likely the case with "application/csv"), then it will download the file and ask the operating system to open it. At that point, the filename assigned to the file (which can be set via the HTTP response) may come into play.
On a Windows machine, the operating system maintains a list of file extensions and actions associated with those extensions. When you install Excel, that will normally make Excel the default "open" action for files with the ".csv" extension. That's why double-clicking on a ".csv" file opens in Excel, and also why it may open in Excel if you download it from a website. (If you didn't have Excel, it may simply ask you what program you want to use).
This is a long-winded way of saying that if you had control over the user's machine you could give the file a different file extension and then associate that extension with an action that did something different. But, I assume that you probably don't have that sort of control unless you're dealing only with in-house users, and anyway it would not be a trivial thing to achieve.
I don't think that there's any way to communicate to Excel via the command line that it should use a particular delimiter when opening a CSV file, and that - unfortunately - is the mechanism by which the operating system will ultimately open the file.
It is possible to control what Excel uses as the default delimiter for all CSV files (see https://superuser.com/a/606274/18472) but again that would require you to change the system-wide settings on your users' machines, which I imagine would not be possible.

how to export datagrid to excel(.xlsx format only) without using server side technology and as3xls?

Presently I am using as3xls.swc to export datagrid to excel which is giving me only to save as .xls format which is opening in microsoft excel 2010 which is OK for me, but it is only opening in protected mode where I am unable to do any edits or save it. So, can anybody know any other way to save as .xlsx format in the client side itself?
Protected mode is a feature of Excel within the Microsoft operating system. They're trying to keep you from inadvertently downloading viruses. You can defeat these measures by modifying the Excel trust store. It has nothing to do with your code, and you don't need to use older versions of Excel.
I find it easiest to add a trusted location (like your desktop).
http://office.microsoft.com/en-us/excel-help/what-is-protected-view-HA010355931.aspx
You can export to Excel2007 - its just an xml file format. WE have some details on our blog: http://blog.flexicious.com/post/Flexicious-30-Release-Grid-Edition.aspx. Keep in mind however, it generates an XML file, which when you double click on, will correctly open up excel (Assuming you have excel 2007 or the reader installed).

Print MS Access report to .xps file using VBA

I am using MS Access 2003 and have seven different reports I have to distribute each morning, and I currently do that manually by printing each to an XPS file. The default printer for each report has been set to XPS file, and I tried this code:
DoCmd.OpenReport ("rptDaily_1of7")
DoCmd.PrintOut acPrintAll,1,,acHigh,1
When I use that, it does open a Save As box, but .tif is the only option in the "Save As type" field. Even if it wasn't though, ideally I'd like to send the file path and name as a parameter and have it handle the entire process (so I can use a loop to generate all seven files with the push of a button). I'm hoping there's another command I can use to do this, or possibly another method. Note that it's not my machine, and I do not have admin rights to install anything else (like a pdf generator, etc.).
You can create your reports as PDF files using ReportToPDF by Stephen Lebans.
This can be easily automated (there is a MDB with example code in the download) and you don't have to install anything.
It comes with two DLLs which you need to put into the same folder as your MDB/MDE, and that's it. No installation / DLL registering, just distribute the two DLLs with your MDB/MDE.
We are using this at work to print thousands of reports per day from Access 2003.