Is it possible to have an excel sheet that gets updated from a mysql server using a specific query when ever it gets opened using VBA?
I am new to VBA and is it possible to monitor the data changes on the excel sheet while updating the sheet??
Thanks
If you use the Data > Get External Data toolbar to set up the MySQL data pull, you can then set the workbook to refresh upon opening - Here's a link that shows the very basics.
As for tracking / moitoring changes, you'd have to be more detailed about how you'd like that to happen... As a general rule, it's not very easy to do.
Hope this helps!!
Related
I have an issue that is quite hard to understand, I'm going to try to explain that:
I have a template xlsx file;
There are some plans on this workbook and a table for each one;
Some columns have formulas and specific formats (colors, time, currency and so one);
If I open directly this template file and insert a new row in any table, things are going well (formulas and formats are being copied for this new row);
However, if I use Closedxml to open it and saving then, even not manipulating anything, when I open the file using Excel and add a new row to some table this new row is coming with no formulas and formats.
I have no idea what's going on and how to fix it but it's invalidating a requirement because I need to open the template, fill some tables and send to the user for download.
ClosedXML version: 0.87.0.0
Example and template file on: https://github.com/ClosedXML/ClosedXML/issues/513
The issue has been fixed on the github issue 513:
https://github.com/ClosedXML/ClosedXML/issues/513
Only need to wait the release of this fix.
I'm looking to write a program to update cells in LibreOffice Calc in real-time (or at least at some fixed tick) with data pulled from a MySQL database. Ideally, when the values in the database are updated, the corresponding cells in the spreadsheet would be updated such that any formulas or calculations existing in calc would continue to operate on the new values. So far, I have yet to find a way to dynamically and programatically insert data in this manner. Is it possible?
The LibreOffice component Base is a database front-end that handles queries, forms, and reports. While by default it uses an embedded version of HyperSQL database to manage the tables, it comes with drivers for any number of other back-end programs, including MySQL.
I think the easiest way to approach this would be to create a Base file with your MySQL database as its back-end (note Base will only be able to see tables and views from MySQL - it won't import queries; although you can save queries in the Base file if you want). Make sure to 'register' the Base file so the rest of LibreOffice can 'see' it. Once the file is registered, any open LibreOffice component can access the data from MySQL (Base file can be closed).
Now you can import any tables or views (from the MySQL component) or queries (from the Base file) into Calc: [Tutorial] Using registered datasources in Calc
Refreshing the imported data can be done through an API call. Here is an example in StarBasic code:
Sub refresh_DBRanges
Dim oDBRangesEnum
Dim oNext
oDBRangesEnum = thisComponent.DatabaseRanges.createEnumeration()
while oDBRangesEnum.hasMoreElements()
oNext = oDBRangesEnum.nextElement()
oNext.refresh()
wend
End Sub
Note in the second posting of the 'registered data sources' tutorial, it gives the API call to set the import ranges on a refresh timer.
Just a note that the Registered DataSources Tutorial is updated further down its page. It says the list of registered data sources can be accessed by hitting F4. That was true once but was changed with version 5. It's now Ctrl+Shft+F4.
Is there any way to fetch the data from MySQL to EXCEL. I tried doing it by a standard way(ODBC).
But is there any way by which all the tables data can be fetched into excel tables at once so that I can draw charts using them. If any data is added in MySQL the updated data should be reflected in Excel when I open it next time and graph should be updated.
Any way to do that?
U need to write code for that.
If u are using .Net then you can directly export file in the form of excel. But if u r using java then u need to write code for that. u need to use jxl.jar .
hint for that is given in URL which is given below.
http://javamix.wordpress.com/2009/05/01/inserting-data-into-excel-sheet-using-jexcel-api/
You can export your data from MySQL as Excel using any of the MySQL GUI tools like SQLyog, MySQL Workbench. I use SQLyog, here is the screen shot attached, where it can be done very easily.
But I fear, there is any direct and simple way to update data in Excel when one changes in MySQL.
Hope this helps.
I am creating a website...and i want to give a liberty to users, to upload the data of excel file and then i want to save that excel data inside mysql database on runtime...
kindly help me in performing this task...
you can mail me at...."amiteshsinha09#rediffmail.com"
thank you
Amitesh
You can query the data in the excel sheet using Open Xml
Using this instead of running Excel via interop is both faster, more stable and saves you licence costs.
I have a csv imported into my Hyperion v8.3 bqy file. I have some custom columns and a pivot already created. I just want to refresh the data. In the past, I would hit Process Current and it would direct me to my computer and I could select the csv file to update from. Now it will not do that. It doesn't go to my computer at all.
Any ideas?
Eric,
I'm not a power user but I accomplish the same thing by ensuring that there is a file with the same name in the same location from which the original csv was imported and "Processing All". This allows me to update the data and import it into my bqy and automatically update any reporting based on the csv.
Don't know if this will help or not.
Dennis
dennis.van.camp#vanderlande.com
When you import a file as a Section into Hyperion, it maintains a link to the existing file for the exact path and file name. When that link is broken and that section gets a Process or Refresh command, is the only time it will prompt you for a new file. Otherwise, it will refresh the data from the existing.
So, if you want to force it to prompt you for a new file, you have to move or rename the old file.
But, you're looking for the Pivot and Computed columns to refresh. Two things on that ...
Computed Columns: You don't have to re-import the file, if the rest of your data is current. Each column can be refreshed individually by right-click, Modify, then clicking Ok. You don't have to change any of the code; just hit okay instead of Cancel.
Pivot: In the menu, you have to set your pivot options appropriately to update when you Process (when the underlying data is Processed, really), or Manually (when you Process that section).