Retrieve cell information from excel file in Sharepoint Online using VBA - excel

In Excel I can read data from another cell in a closed spreadsheet that is on Sharepoint Online by using this formula.
='https://mycompany.sharepoint.com/sites/Site/Shared Documents/[Excel.xlsx]Sheet'!A1
It doesn't visibly open any workbooks files to get this information.
How do I get the data using VBA, say to set a string value. Every guidance I have seen involves Workbooks.open but I think it shouldn't be necessary to open the workbook?

Related

Create PDF bookmarks Within Excel Workbook

I'm attempting to build a monthly process that converts an excel file to a PDF with bookmarks for each respective sheet. I'm not seeing a method to successfully create PDF bookmarks from within the Excel workbook. Can this be accomplished without third-party software?
What I've tried:
Using Header 1 for a cell as well as an entire row.
Putting Excel Book Mark within the file using a hyperlink reference.
Adding named range.
OneDrive flow Convert File
Adding a Header.
Reviewed some VBA Ref libraries hoping to find an object.bookmark type approach.
Unfortunately, all attempts have resulted in a PDF file with no bookmarks.
Is there a method to create PDF Bookmarks from Excel? Possibly a VBA ref library that I am unaware of or some front-end trick? Unfortunately, I'm stuck working only with Microsoft tools. Adobe's Excel Add-On does exactly what I'm trying to achieve.

Use formula across embedded excel sheets in MS Word (Office 365)

I have an excel sheet embedded in an MS-Word document. At another place in same document I want to put in some outcomes from the embedded spreadsheet (2 cells in particular). The word file needs to be shareable too.
I have tried "linking" excel sheet, but then have to share it (the excel) along with the docx file. Also tried embedding different spreadsheet, but the formulas in the sheets do not talk (or cannot talk to my knowledge)
Is there any way to do this in easy fashion?
What you are asking is not possible. The only workarounds would be to use:
a) an external Excel workbook, with each of your embedded worksheets linked to that; or
b) a macro to activate a given 'source' embedded worksheet in the document, gather the required data from there, then insert that data in the corresponding 'target' worksheet.

open an specific excel sheet from powerpoint using object

Im trying to open a specific excel sheet from my PPt-slide using "insert>>object".
So my Excel Workbook is calling " mape1", and in this Workbook here are many sheets, and I want to open a specific one called "sheet1".
I gave the following pfad in the "object"
As Example
C:\Users\me\Desktop\mappe1\sheet1.xls
But it doesn't work
what am I missing?
Thank you for your help
Check out this support article from Microsoft I've linked below. It says by using the insert method you will bring in "all data from the active, top spreadsheet in the linked Excel workbook."
I suggest copy and pasting the selection you want into PowerPoint as is described here:
https://support.office.com/en-us/article/Import-data-from-Excel-into-PowerPoint-3ec295e9-1bfd-47ff-8d7d-8b838caef853#__toc241650191

Treat .mdb as .xlsx?

I recently made an Excel workbook (with the help of Stackoverflow) where I have a regular input of data (each entry is one row with different columns). I then have a macro that extracts the data from a specified row to a different sheet and saves this sheet as a .PDF.
That way, I can extract specific data from this Excel "database" to a readable pdf. I do this because I need a paper version from specific entries.
For a different project I need to implement the same principle. The only difference is that I need to work with an .mdb file where the data is stored, instead of an Excel workbook.
Is there a way I can reuse my code from Excel or is it now a completely different story?
Thank you for the advice.
You can link your excel workbook to your Access tables. On the "DATA" ribbon there is a section for "External Data".
Once you've got the Access data displayed on one of your worksheets, you should be able to adapt your existing code accordingly.
From Microsoft:
Connect an Access database to your workbook

Use SSIS to populate Excel workbook generated using OOXML

We are trying to generate MS Excel workbook using OOXML and populate data using SSIS.
We are able to generate Workbook and sheets, also able to create columns and insert data in the Header cell. We can also populate data using SSIS.
But the Sheet (DocumentFormat.OpenXml.Spreadsheet.Sheet) and all cells (DocumentFormat.OpenXml.Spreadsheet.Cell) becomes OpenXmlUnknownElement. So we are not able to read sheet / cell using following code: Sheet sheet = workbookPart.Workbook.Descendants<Sheet>().Where(s => s.Name == "Sheet1").SingleOrDefault<Sheet>();
We are able to read the same file if we first open it using MS Excel and save. Does anyone know how to resolve this?
You probably forgot to give your sheet a name. You can see this by using
Sheet sheet = workbookPart.Workbook.Descendants<Sheet>().FirstOrDefault
and you'll see that your sheet name is either undefined or garbage text.
If that does not help. Create a simple document in code save it in OOXML and open it in a xml viewer. then make a copy open it in Excel and save it and see the difference in xml. That is often a good start seeing what excel has added by default to the document.
Excel is very tolerant of things that you have done wrong when creating the document in code, and magically fix them when you open the document again.
A bad hack would be using interop to open the document saving it again in code. wich would fix everything for you.
Workbook wrkbk = app.Workbooks.Open(#"c:\del.xls");
wrkbk.Save();
wrkbk.Close();

Resources