How to Get Data on Close Workbook Table on Excel VBA without Openning It? - excel

I have three Workbook,
First is for my Inventory System for Admin,
Second is my Inventory System for Employees, and
Third is my Database.
Does anyone know how to get Data Table on Database without Opening it and put it either in Admin or Employee's Inventory System?

All you need to do is go to "Data" tab in ribbon > Get Data > From File > From Workbook. Then open the "Database" excel file.
This will allows you to preview the data from the "Database" sheet. If you don't need to make any changes you can click load directly and the data will be copied.
You can check out this video for more examples on how to use Power query.
I also recommend checking out this video on how Power Query can help you.

Related

"This workbook contains external data. Do you want Microsoft Excel to clear the data before saving" prompt

I have created a macro-enabled template, which contains only a empty dataset sheet sourced to a number of pivot tables.
Every time I try to save the template proper, or even a new workbook based on the template, I get the error:
This workbook contains external data. Do you want Microsoft Excel to clear the data before saving the template, and then automatically refresh the data whenever the template is opened?
There are no connections in data>connections>connections.
Edit Links is grayed-out in data>connections.
I have downloaded and ran "https://www.manville.org.uk/software/findlink.htm" with no links found.
The only item in formulas>name manager the dataset table with no external link.
I have unchecked file>options>advanced>ask to update automatic links.
I have enabled all items in file>options>trust center>external content.
I can't find anything in my VBA code that would cause an error like this.
This error prompt haunts me. Why is it doing this?
Thanks for any answers.
You most likely have a formula in a cell or a define name that points to an external file. Do a search for "HTTP" in your workbook and review your define name.
As it turns out, it's just a source template thing. Once I open a new document from the template, that warning doesn't come up.

Table not shown in VBAs project explorer

I have a excel worksheet with two tables, tableOne and tableTwo. In VBAs project explorer, tableOne is shown (created first), tableTwo not ( created later). I need to create custom code for both tables and I would like to display them on the same worksheet. Looks like VBA allows only one table per worksheet. I verified this on another worksheet with two tables - same result. Googled for some hints but did not get anything. Please advise
You can easily try it yourself. Open a new workbook, got to first worksheet and create to tables there (i.e. format a range as table). If you open the VBA project explorer, you'll see only the table you created first. I'm not that expierienced in VBA and google did not provide much help. AFAIK, if I want to add custom code to an object (i.e. event handling), I need to attach it to the object. As second table is missing, no way of doing any event handling there

Stop updating PowerPivot when opening Worksheet

I have an excel workbook that is to be used as a report, that is distributed to different people. The workbook gets data from an input file (another Excel file) that is not available to all the people who are receiving the report.
My problem is, that when the people who does not have access to the input file opens the report, the workbook tries to update the data, but fails, as the user does not have access to the input file. Is there a way to stop the sheet from auto-updating when it is opened?
Based on the versions of excel I have used, Excel 2013 and 2016 that does not sound like the standard behavior I have seen.
There would be a couple things to check:
1) Is there macros in the file, which run on open and force refresh. VBA command to refresh a data model being the following ThisWorkbook.Model.Refresh
2) Right click on the pivot tables --> Pivot table settings --> Data, check if refresh data when opening the file is selected. Not sure on this one but it might be forcing a refresh of the model.
3) If you are using power query, open the queries & connection tab, right click each query and select properties. There is an option for Refresh data when opening the file.

How to create a drop-down list in a excel file with data coming from another Excel file used like database?

I'm using an Excel file like a Database.
I have another Excel file that need to be filled with information coming from the Excel file Database.
Is it possible for the Excel Database file to populate lists into my other excel file ?
Thanks a lot
Under the Developer tab in Excel you can select 'Insert' and then 'Listbox'. Create your list box in excel, then right click the box and press "Format Control". Under the "Control" tab, you can change your Input range which can be used across different worksheets thus creating a list. From there you can assign macros of your choice such as a ListBox_Change macro.
Typically you can make a list box in Excel using Data Validation, but that will only work within the same workbook.

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

Resources