"The Business" wrote a sophisticated Excel VBA Macro that scans multiple complex and irregular (multiple logical tables per tab) spreadsheets and produces a summary XLS. Management wants IT to "productionize it" and run it on a server.
I've seen example of using the Jet drive to read regular tables (1 per tab) in a spreadsheet, but the spreadsheets are irregular and this macro does more than read, it sets cell formulas, etc. Therefore, I guess we need full VBA.
How do you do this in production if you can't install Excel on a production server?
You can use a library for interacting with Excel files like Spreadsheet Gear for instance... I am sure there are plenty of others. You can then read the Excel files and then produce the summary XLS. You'd need to tie it all together using VB. You wouldn't need to install Excel on the production server though.
Related
So I have never used Excel macros before, and am not experienced in this, but have a (very) rough idea of how things work. I have tried looking up solutions but too inexperienced to convert them to my situation.
I have to import data from many excel files into one main database, and have this going at the click of a button, as there are new files being generated daily.
I can set up the data files to have the values in a consistent format on the first sheet of the file, as a start. From there I am not sure of the coding I need to use to get the data imported to the database file and append it to the bottom of a list.
Any help would be greatly appreciated.
By "one main database" are you referring to an actual database (e.g. SQL Server) or an Excel file. If an excel file, I'd use PowerQuery for this. It's built into Excel 2016, available as a free add-in for Excel 2010/2013, and designed so that non-coders can do incredible data cleaning and prep work from a fairly easy-to-use UI built right into Excel. Plenty of tutorials on the web and youtube, as well as great books such as M is for Data Monkeys by Ken Puls.
Hi and thanks in advance for the help.
I have an Access 2007 database that has tables created by live links to several Microsoft Excel 2010 spreadsheets.
I have several Access macros that run queries against these linked tables, and I find that the formatting of the output is in very strange formatting if I run the macros, without first having those linked Excel spreadsheet files open.
To put it another way, if I open the linked spreadsheets and run the Access macros, all the data formats correctly, but if I have the linked Excel spreadsheets closed when I run my Access macros, the formatting goes all funny - particularly with date fields.
Can anyone offer any advice on how I can resolve this problem?
Many thanks
Kim
I usually create a straight select query for each linked Excel table.
In this you can force any formatting or conversion you may need as well as using alias to obtain more friendly field names.
Then use this query and not the linked table for the further processing.
I have tried the various different methods that Excel offers to work with external data.
I have inherited a system in work that involves copy and pasting data from one SSRS report into a pretty complex Excel workbook. I want to automate this system, but for the time being I still have to work with the Excel file.
This Excel file needs to be updated daily - I want to schedule the SSRS report using Windows File Sharing; have it run every day and have the Excel workbook look at the report each time the spreadsheet is opened, updating (adding data to) various tables and cells with the values in the report.
I'm finding this process really unstable. It will work for some reports, but not others. Any pivot charts based on the connection will lose their data and formatting if the sheets cannot link to each other. On opening the main, destination excel file, I get errors about links not being updated, etc. Browsing for the file and reconnecting it works, but this defeats the object.
Could the be something integral to these set up working every time that I might be missing, or does Excel have a feature that better suits what I'm trying to do?
Many thanks for your help!
I'm using SQL Server 2005, Excel 2013 and the reports and datasheet are stored in a shared folder
I think you are heading down a dead-end. You will never have enough control over the rendered output from SSRS and any solution will be fragile.
I assume the SSRS data source is SQL or some other source that Excel can read. I would take the Dataset code from the SSRS report and implement it as Data tables in Excel, e.g. Data ribbon / Get External Data.
In the simplest implementation, each query just populates an Excel Table. You can set the connection definitions to auto-refresh on open.
For more complex requirements you can build an Analysis Model in Excel using the Power Pivot Add-In (included (but not enabled) with Excel 2013). This lets you relate datasets to each other and add calculations etc. The gotcha here is that you cant auto-refresh without SharePoint.
Basically I have a master workbook on a network drive which is used by many to update the sheet, I want to automate this, through my research I found there are many complications with it if I automate it.
Searching on Google gave me the following suggestions and I have noted some complications with these solutions
using VBA open and write data and close it.
there are chances that Excel is already opened by others and it is in read only mode, so I can't write. Even though I tried open and write but it's taking too long getting stuck.
Share the workbook and write data
for this to happen the workbook should be opened and shared by one at least, while writing data if two people are writing data at a time there is a chance that one could overwrite data of others
using ADO write data into Excel
I don't have any idea about ADO and how it can be used to write data into Excel, saw some examples and ended up nothing to comprehend.
Set up an Access database
Connect to the database from an Excel: Go to the ribbon: Data > From Access. This almost works like a pivot table and is indeed view only.
You can also store all the data still in an Excel and again use the External Data options (From Other Sources > Wizard > Other/Advanced > (tab) Connection > Use data source name > Excel Files > OK) to connect to it from a central Excel that all users use.
For writing to your database I would recommend using VBA nonetheless, if thats beyond you then you might want to get busy with it soon as that would probably be the best way for you to enable your users to write.
i have 500 excel sheets which are used for data collection from various organisations
i need to collate all the data into a variety of summary excel sheets
at the moment this is all done manually, cut and paste and then create big forumlas to calculate across several sheets to tally it up
i am looking to automate this somehow, I would like to run a set of tests on the excel files to make sure the data is correct, and them import it all into a database, and then spit summary sheets back out in excel format.
is there something out there that does this sort of thing already, based on a set of rules ?
I've built a number of excel projects where I needed to import data from an uploaded spreadsheet. I used this library and built what i needed out of it:
http://excelpackage.codeplex.com
Example to read data:
http://excelpackage.codeplex.com/Wiki/View.aspx?title=Reading%20data%20from%20an%20Excel%20spreadsheet
It's a .net solution though...