I have SSIS code that converts Excel to PDF in a script task similar to this posts code: Code to Convert Excel to PDF using VB.NET. The SSIS job runs all the way to where it exports to excel:
oWorkbook.ExportAsFixedFormat(pFormatType, PDFFileName, pQuality, _
pIncludeDocProperties, _
pIgnorePrintAreas, _
pFrom, pTo, pOpenAfterPublish)
Once it hits this block of code my SSIS job freezes. I have my application.displayalerts set to false thinking that somethiing pops up but that is not the problem. I also have PDF reader installed on my server and that doesn't help either. This code works on my PC but not on the server. I cannot seem to figure out why this is happening. It seems like the code referenced in the link does work also. Any ideas why my code doesn't work on my server?
You can't reliably call desktop applications from a server process that has no desktop.
It's probably missing something like Acrobat or a print queue and is waiting for user input that will never come.
If you need to reliably create PDFs from excel using an automated process, you'll need to look at 3rd party tools or writing something.
I can't locate it right now, but Microsoft has a technote somewhere that mentions this.
So I dug a bit deeper. I was able to run SQL Agent in interactive mode and I could see a pop up stuck in Excel (or at least see a pop up with a title "printer setup", the screen was all wigged out otherwise). I googled that and found this other posting: Excel automation: PDF export causes "Printer setup" popup that describes my problem. He fixed his problem, which worked for me as well, by changing the default printer to the microsoft XPS document printer. Hope this helps someone else.
Related
Is there a way to enable matplotlib/ipython so I can right click my plots (in Chrome) and copy then paste elsewhere such as MS Word etc?
I know I can code and save to image etc, but often when I am playing around investigating data it would be very useful to just copy / paste into a document for safekeeping and reports.
EDIT: Problem seems to be using MS Word (2010) and any dynamic image from any Browser (IE/Chrome), If I use other progs like Write it works okay. I found some advice to change the "Pasting from other programs" option in Word settings but it has no effect.
Also another article says the problem is based on the contents of the "HTML Format" format stored in the clipboard.
Guess I need to post this question elsewhere seems to be an MS Word issue!
If you control-shift right click, it'll return to the standard Chrome context menu instead of the iPython one.
EDIT: the below answer doesn't always work anymore (something changed I think), but there is another stack overflow question here with an answer that is working, namely using Ctrl+Alt+V to do a paste-special:
Jupyter Notebook: How to copy paste image into MS word?
A straight Ctrl+V will generally fail in MS Office for this purpose, but there is the "paste image" option which is what is working for me.
If you're using ipython notebook (which I guess you must be, since you're mentioning using Chrome), you can just right-click on your graph and choose Copy Image then paste into whatever software
Drag and drop worked for me using Chrome and MS Word on macOS.
For about 6 months I have had a functional excel spreadsheet that when clicking a button ran a VBA script that created a properly formatted kml file from the lat/long information in the spreadsheet, saved the kml document, and launched Google Earth to view the plotted coordinates.
I successfully used this on June 6th. However, today I am getting this error
"License information for this component not found. You do not have an
appropriate license to use this functionality in the design
environment"
The KML file is still created and saved, but GE will no longer launch.
I have tried this Microsoft fix, but it didn't resolve the problem.
https://support.microsoft.com/en-us/kb/181854/en-us
Below is the part of the VBA that launches Google Earth. The "GEPlugin Type Library" reference is still checked in Microsoft Visual Basic for Applications :
Dim appGoogleEarth As EARTHLib.ApplicationGE
Set appGoogleEarth = New EARTHLib.ApplicationGE
Call appGoogleEarth.OpenKmlFile(OutputFile, 1)
Any help or insight into why this suddenly became a problem and how to fix it is greatly appreciated.
Google Earth Pro don't provide a library like the old version of GE. Then come back to the old version if you want use your XLS spreadsheet.
I am working with a Microsoft Access database that was mostly completed in Access 2010, and now I am opening it on a new computer that has Access 2013.
Upon opening the program, it tells me,
"Microsoft Access database or project contains a missing or broken reference to the file 'acrobat.tlb' version 1.1."
I have done some research, and I know that I need to go into the VB code and go under tools->references. Now under here it lists the working references then says,
"MISSING: Adobe Acrobat 10.0 Type Library"
So now I understand, that I need to give it the reference to that .tlb file. I am good up to here, but whenever I try to browse I can never find this file. I just downloaded Adobe, so I know I have the most recent version.
I saw a couple places in my research that you can just uncheck the box and try compiling again. This however does not work for me. it needs this reference for several things I am doing.
Has anyone ever had this problem or have any guidance for me?
Thank you!
I'm not 100% on this, but loading Adobe by itself may not give you the library you are looking for. You could need the file which is located in the SDK (which happens to be free) adobe site. Try installing this, and see if you can navigate to the tlb.
SQL hound was right. To expand on what he suggested and be more specific for this issue for those with this problem in the future, you need to download the Acrobat DC SDK (not the air one). In InterappCommunicationSupport/Headers you will find acrobat.tlb.
I am using Access 2013 and Acrobat Pro version 11.0.
I have looked for the file "acrobat.tlb" on my drives.
Found it under: "C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat"
In the Visual Basic Code "tools/references", I clicked "Browse" and went to the location I have found, selected the file and clicked OK.
Returning back to "tools/references", the "Adobe Acrobat 10.0 Type Library" is now available and selected.
I have run minimal code to open and show the number of pages of the opened "pdf" document and it returned the proper number of pages.
Just so you know:
I now remember that there was a selection called only "acrobat", it is now gone. Must have been caused by selecting manually the desired file.
Maybe that selection was pointing to the "acrobat.tlb" file.
You can see the full path and name of the file corresponding to the selected library name at the bottom of the reference window.
I had the same problem but I had a Missing reference to "...Adobe 9...Type Library..." I unchecked that and tryed with, "Acrobat Access 3.0 Type Library" futher down. Then it worked.
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 have written a code which utilizes Word Automation Service in order to convert the .DOCX file to the .PDF. I have noticed that in case the Word document contains a table of contents, its links are removed in the PDF. This is very bad for my business case.
On the other hand, manually opening MS Word and saving the same document as PDF preserves the links in the table of contents. This is the behavior I am looking for, but I want to keep my code independent form having MS Office Word installed on the machine running my code.
Has anyone had the similar issue and was anybody able to resolve it?
In my case, i found out that this is something related to Job Settings property. Try to comment or remove this line of code if you have one:
jobSettings.UpdateFields = true;