Linking Access records to Excel files - ms-access

I've been trying to create a complete system using MS Access, but i really need to use the functionality of excel spreadsheets.
I wish to do the following; when I create a record, i create a directory for that record, and copy an excel spreadsheet to that directory.
The spreadsheet will be able to link to the corresponding record. So for example if I have a field 'Name' In the database record, the value of this field will show up on the excel spreadsheet.
Is it possible to do this?

It might help for you to explain your concept of "links" between Access rows and separate spreadsheets. That baffles me.
Rather than "link" each Access record to a separate spreadsheet, perhaps you could have the spreadsheet query the database to retrieve whatever updated information it needs.
Or use automation driven from Access to revise the spreadsheet.
Edit: To get start driving Excel from Access, look at Sample Excel Automation by Dev Ashish

Sounds overly complex and unmaintainable. Why not just embed a spreadsheet into your record?
http://support.microsoft.com/kb/209990

Related

Macro to delete the old data

I'm really new to this and would love some help where I'm currently stuck. I've created a macro to clear a spreadsheet. I've tried multiple triggers of onedit and onchange and haven't had luck with my end goal. I'm sending data (about 10 columns and 100 rows into a google sheets via zapier. Basically, I'm refreshing the data by replacing the data. So, before the data comes in, I wanted the macro to delete the old data. However, the macro actually deletes the new data coming in once it posts. Any scripts or workarounds that could help?
From what I know about Zapier it works on timed intervals. You can have a script run on time intervals just before the time Zapier inputs information and delete the old info.
Another approach would probably be to have a intermediary sheet.(Lets call this sheet, "sheet1". The final sheet can be called "sheet2". When Zapier writes data to sheet1 it can trigger the onChanged event. Take the information in sheet2 delete everything, then post the new data to sheet 2.
Finally, Zapier supports webhooks. You can publish your script as a web app and have it do a get or post to the app which runs the delete function. To give it time you can use the delay that Zapier provides.
What you are describing sounds like the perfect candidate for the IMPORTDATA worksheet function. The function is entered in a cell, as are all worksheet functions, and it takes a URL which points to a CSV or TSV file. Once entered the data referred to by the URL is expanded out into the appropriate number of rows and columns. Seeing as the function resides in a single cell you would only need to update that cell when you wanted to change the data. This means that you would no longer need to use a .gs file to remove old data and could instead complete everything from within Zapier. I have answered a question similar to this here, I describe how this is done within Zapier. The only prerequisite is that the data you are using is in either CSV or TSV format.

Reference a spreadsheet created from SSRS

I currently have a separate speadsheet that contain formulas that reference a spreadsheet generated by SSRS however the SSRS spreadsheet is set to overwrite the data and it seems to delete the spreadsheet and creates a new one in its place which breaks the formulas.
Is there a way to not overwrite the spreadsheet so that it doesnt break the formulas or is there another alternative?
Thanks in advance
What you ask about is not possible with SSRS. If you would like to have the ability to update the data in an Excel spreadsheet and maintain the formulas, PowerPivot is a solution.
Create an Excel workbook (or use the one you mention in your question), and add a Power Pivot data source and pivot table on one of the sheets in the workbook. Make sure the data pulled with PowerPivot includes all the data you need, and pivot table display all of that information.
On another sheet, add your formulas and references to use the pivot table you created in the steps above.
Then, when you updated the spreadsheet data, the formulas will update and not be lost or broken. If you have SharePoint where you are, you can upload the spreadsheet into a document list, and set it to update on a schedule.

Looking to create a Google App Script that duplicates a complicated sheet? Ideas?

In the end, I want to make a script that creates a folder that has other folders in it with a bunch of copies of a custom data sheet our school is using for data analysis.
As of now, I have created a whole system of Google Data Sheets that are connected through the IMPORTRANGE feature of Google sheets that our school uses to compare data. I would like to implement this system in other schools and wanted to try and write a Google App Script to set it up.
I have a couple of questions:
Is it possible to use a script to create a document is automatically set up to use the IMPORTRANGE feature to import data from another document?
If I have a sheet set up already (the standard data sheet we use) that I want to make 400 copies of in different folders, do I have to code the script to generate this document from scratch? Do I code it to pull a copy from somewhere? What do you guys think?
Does this even seem like something that's possible?
Thanks so much for your help guys!
Brandon
Sure. After you create the document, you'll just insert =IMPORTRANGE() using setFormula() or setFormulas(). You will have to manually grant permission for the sheet to import ranges the first time you open it, and any time after when you insert =IMPORTRANGE() with a reference to a new sheet, though.
This is no problem either. You can use the Drive Service and makeCopy() to copy a file into a destination folder you specify.

How to hide certain columns for a user?

On a shared Google spreadsheet:
I don't want a specific user in my domain to view columns with sensitive data, but this person should still be able to edit the rest of the spreadsheet.
I tried creating a 'master' spreadsheet and using importrange to bring the data into a 'shared' sheet, but once I edit any cell in the shared spreadsheet, importrange no longer works as the sheet is emptied out.
Is there a quick way to do this, maybe using scripting?
After some research and trying various different options, I was finally able to achieve what I want using the importrange function.
At first, I tried using a combination of hide columns & protect range, but this wouldn't work because a simple copy & paste would reveal the contents of the hidden columns.
Solution: The 'master' spreadsheet does not have any sensitive column data and can be shared with everyone in the organization... I then ADD the sensitive data to a new spreadsheet and use importrange to grab contents from the 'master'. (Previously I had the roles reversed, but this didn't work)
You may want to add unique keys per row entry so that sorting etc won't mess things up when you zip-up the sensitive data and the 'master' data.
I came here looking for a way to share only certain columns of a spreadsheet with a customer, but not all.
As noted in the other answer, using =IMPORTRANGE works well, but a clever customer could simply edit the function and see the other columns.
My solution was to first create a 'proxy' spreadsheet that imported only the columns I want the customer to see. This proxy spreadsheet is not shared.
Then, I created another spreadsheet that imported the columns from the proxy, and shared that spreadsheet with the customer. This way, even with edit privileges, it's impossible for him to see anything that isn't on the proxy spreadsheet.
A bit clunky to be sure, but it worked perfectly for my situation.

Multiple users using spreadsheet without overwriting content

I'm new and appreciate help on my question!
My spreadsheet acts as a sales tool, where info is entered in various cells to run sensitivity analysis. Once the salesperson picks a desired option they "submit it". The data submitted is then stored on a separate sheet in the spreadsheet (call it the "database").
I want the database sheet to store all user submissions. The problem is when multiple users are using the sales tool worksheet at the same time, the info they enter gets overwritten by other user's inputs before they can submit.
I'd like multiple users to be able to use the "sales tool" sheet simultaneously without overwriting eachother, but still be able to submit data to the "database" sheet.
Appreciate ideas?
You can use the Lock Service to take a lock on the spreadsheet and then release it once you've written to it.
Besides the Lock Service (already mentioned by Srik) there's the Sheet.appendRow function, which is way easier to use and much faster. But only makes sense if you're inserting new data to a sheet and not really writing to the same cells.
Can't you use a form?
This way people could insert data without actually modify the spreadsheet...