We have an Excel Online file that I'd like to link to, but as a pdf. In other words, I want a link that opens the contents of the Excel Online file as a PDF file. Ideally, admin users would be able to edit the excel file, then end-users would be able to open the PDF version of that file, as it is continuously updated by the admin users. Is this possible? I would need a link to the PDF version of the file.
I did come across this thread, but the answer isn't actually answering the question. https://superuser.com/questions/1133384/is-it-possible-to-link-or-sync-an-excel-spreadsheet-with-a-pdf
Based on your response above I believe the following may accomplish what you want.
What you will need to do is enable the Developer Tab in Excel so we can create Macros. We will be creating a Macro that will Save the excel file as a PDF. My assumption is that there is one worksheet in the excel file. When you enable the macros, and save the first time it you will need to save it as a xlsm file to save the macros with the file. Once you do this perform the following below.
In Onedrive create a new folder and call it "MyPubDocs" for example.
In Excel open up your online Xlsm file and do a SaveAs
In the file dialog Box navigate to the Onedrive folder you created and take note of the folder name. It might show...
Web Sites > https://d.docs.live.net > > MyPubDocs
Click on the header bar and copy the URL and save it.
In Excel go to the developer Tab, if you don't see then go to File Menu -> Options -> Customize RIbbons -> Popular Commands (left) and Main Tabs (right) and check the Developer checkbox. click OK.
Click on Macro Button Set the Macro name to "SaveToOneDrive" ad click create.
That should open a IDE where you will paste the following command.
ActiveWorkbook.SaveAs Filename:="https://d.docs.live.net/XXXXXXXXXXXXXX/MyPubDocs/" & "MyExcelFileExportAsPDF.Pdf"
When creating the macro you should be able to assign a hotkey to that macro.
Now whenever the admin finishes saving the excel file, they can press the hotkey or run the macro and it will save the file to the location.
If you want to associate the macro to the save event of the workbook, you can, but auto save should be turned off.
After the first time you saved the pdf, go to onedirve and navigate to the pdf file. Create a sharable link that you can distribute to your users. When they navigate to that sharable link it should show them the most recent pdf.
HTH
Related
I am a system programmer and what i want to do is to send daily a csv file to a group of administrators by mail. They click on the attachment and it opens in Excel with a corresponding chart.
This means that all the code to generate the excel chart is embedded in the file.
As this is a corporate usage, i suppose that i can only use strict Excel available tools.
Do you think that it is possible to do this ?
( I can't generate the graph first and send it because on the machine where the data comes from there is a very strict security restriction and we can't install extra software)
as far as I know it is not possible to save & run a macro in a csv file. Therefore my suggestion will be;
Record or write a macro (named csvChartMacro lets say) in an excel file which will create your chart.
Then save this file as an .xlam addin file and put it somewhere in your network.
Inform your users to open this .xlam file after opening the csv file and while csv is the active window tell them to hit Alt + F8 and run macro csvChartMacro to create their graphs.
p.s. if this type of needs grow in future, you can add related macro operations in the same xlam file and maybe you can create a ribbon tab and assign your macros to buttons in that ribbon tab.
I made a VB script that re-formats data exported to excel from a website so that it is compatible with a geocoder. As of now every export I have to go in, past the VB code run it and save the changes. I am wondering if there is a way to make the VB code available as a tool for all workbooks so it is just a matter of opening the xls file clicking a button and saving it?
To expand a little on BigBen's comment:
Open the Excel file with your code in. Open a new blank Workbook. Open up the VBA Editor (Alt-F11).
Drag the module which contains your code to the new workbook (in the left-hand navigator pane). You should see it add to this new Workbook.
Save you new workbook as MyFunctions (or whatever name you fancy) but choose the "Excel Add-in (*.xlam)" file type. You should see a new file appear in your folder as MyFunctions.xlam.
Back in Excel, from the File menu, choose Options (right at the bottom). And then Add-Ins from the left-hand list. At the bottom will be a drop-down box "Manage: Excel Add Ins". Hit Go...
You'll a list of the add-ins that your Excel knows about: some will be checked (that is they will be loaded at start-up) and some not.
Choose Browse, and navigate to wherever you saved MyFunctions.xlam. And double click on it. You may get a security warning (as your addin doesnt have a digital signature) but just go ahead and enable it (as you wrote the code: this is not blanket advice!). Close Excel (this remembers your choices).
When you next open Excel you should see your add-in file open in the VBA Editor, and your macros and UDFs available in whatever worksheet you are using.
I've got an Excel add-in file (.xlam) stored in a shared location, and a bunch of custom Ribbon buttons linking to the macros in that file. When user clicks on the button, the add-in is opened for them, and the macro from that add-in runs. There are many users of that add-in, and they constantly have Excel open, so when I need to make an update to the add-in, I have to ask everyone to close all Excel files and wait for me to complete the update. Therefore, I'm wondering if it's possible to always make the add-in open as read-only when called from the Ribbon?
Not exactly answering the question in the header, but I solved my problem, and maybe someone finds it useful as well.
Solution is very simple: right click on the .xlam file in question, select "Properties" and tick "Read-Only". It will always open as read-only, not just when called from Ribbon, but you can make changes to the file by saving it in another location, and then replacing the original file.
I am trying to turn a custom ribbon button I made into an add-in that others can use for any worksheet in Excel. I followed this StackExchange post on making a custom ribbon tab to make the ribbon button, and I have it successfully working within one workbook (one Excel Macro Enabled file).
How can I export the ribbon tab XML along with the VBA callback module so another user can use this in their Excel installation?
Thanks!
There are a few ways to do it. The simplest one is to put your .xlsm file in a known start-up folder like XLSTART.
To find the folders' location, in Excel:
Go to File > Options > Trust Center
Click Trust Center Settings...
Go to Trusted Locations
Put your file in one of the listed XLSTART or STARTUP locations.
The locations look something like this C:\Program Files\Microsoft Office\Root\Office<XX>\XLSTART\ for the whole computer, or like C:\Users\<User>\AppData\Roaming\Microsoft\Excel\XLSTART\ for the user.
When you restart Excel the file should be loaded automatically.
In addition: Saving your file as a .xlam will also make it behave as an add-in, and will not show the worksheet. You can find some information about the file type choice here Excel: Book or Addin.
I have written a macro in Excel. When I send it to some user, he should not be able to see the macro.
Say I have a Excel workbook sample.xls, and it has a macro button to save the workbook to the server. When some other user opens the workbook, he should not be able to edit the macro behind that button.
How do I block other users from editing the code?
To lock a VBA project for viewing
Open the document, template, or database that contains the VBA project you want to protect. For Outlook or FrontPage, start Outlook or FrontPage on the computer that contains the VBA project you want to protect.
Open the Visual Basic Editor.
In the Project Explorer, right-click the project you want to protect, and then click ProjectName Properties on the shortcut menu.
On the Protection tab, select the Lock project for viewing check box, enter and confirm the password, and then click OK.
You can password protect it. But I'd suggest you search how to do it for your specific version of MS Excel. There is a link which shows how to do it in MS Excel 2003, I think: http://www.ozgrid.com/VBA/protect-vba-code.htm