How to copy data from an excel sheet to another excel sheet uploaded in sharepoint using VBA? - vba

i would like to ask if it's possible to copy or transfer data from an excel sheet to a worksheet uploaded in SharePoint without the need of opening the file from the SharePoint. Could this be done with VBA? You're prompt response is much appreciated. Thanks a lot!

If you have access to Sharepoint you can use this code:
Excel VBA Up-/Download from multiple SharePoint folders
in order to open the SharePoint folders as network drive and access the files using filesystemobject or dir like you would do it on your local hard disk.
I currently recommend this method if you've enough drive letters available. 1 Letter is 1 folder. You can also connect to a root folder on SharePoint and browse to subfolders like you do it in explorer.
I hope it will help you. If you have any question, just ask.

Related

VBA or BATCH file to repair/compact Microsoft Access files in a folder

I have a folder, with several subfolders, and inside of each one, there are several ms access files.
Currently, I open and compact/repair each one.
Could someone share some simple code to accomplish this programmatically?
It can do VBA inside ms access, Excel file, or a simple batch file.
You can open each database file with a command line switch: /compact
It is documented here:
Command-line switches for Microsoft Office products (Access)

MS access editing an attachment object in vba

I am trying to take an attached excel file from a DAO.recordset, open it, edit it with new information and resave the file to the database all within MS Access 2007. Currently I am having trouble finding any similar task that someone has completed so that I can see how to open an attachment object from a DAO.recordset within vba. I'm guessing it isn't too bad to do once I get past the opening a saved attachment part. I have yet to find any reference material on this topic. Has anyone done anything like this or know how to edit an attachment within vba?
Any insight would be much appreciated.
Thanks
An attached Excel worksheet or Named Range is read-only from Access since version 2000.
You should browse for automation - on how to open Excel from Access and then manipulate the worksheet. Plenty of examples out there.

Excel Services Sharepoint 2010 removes macros from xlsm file

I am using Excel Services in Sharepoint 2010 to inject some data into an Excel xlsm file. This is working fine.
I know that macros will not run on the Sharepoint server, but I want users to be able to download the full workbook after the data injection and have the macros enabled in the full workbook. But, it seems that when Excel Services injects the data, the workbook is always saved with the macros stripped out of the file. Is there any way around this?
How does Excel Services "inject" data? Consider using a data connection in the Excel file instead.
To do that, create a view that shows the data you want and export to Excel. The file now has a data connection to the SharePoint list. You can configure the connection settings and use the data in the spreadsheet. You can hide the sheet with the SharePoint data if it messes up the workbook look.
Or, use the file "injected" with Excel Services as a source file and create a separate file that runs the VBA. Open the injected file and read its data with VBA.

SharePoint temporary location

I am working with SharePoint 2010. I need to get the data from excel file stored in sharepoint library. I have plans to accomplish this by using OLEDB connection. So I need to download the excel file from doc library and store it in a temporary location and then access this temp file to get data from it. Now my question is which is the best ans safe location to stored the downloaded file? So far I have used SharePoint's layouts directory, C:windows:TEMP and even Path.GetTempFileName(). But the result I get this is " ACCESS DENIED!". Any ideas in temporary location? Is there any other location which is safe?
Thanks
Check whether you are running the file saving code with Run with elevated privileges and the app pool account has write access to the provided path. It's not a good practice to store temp files inside 14 hive.
Why don't you use Excel Web services to read the excel file if your farm has excel services enabled.
Refer http://msdn.microsoft.com/en-us/library/ms500767%28v=office.14%29.aspx
Or else try to use third party libraries like EPPlus where you can open the excel file using a stream rather than from a physical file location.

creating an excel add-in

can someone please get me started on the following:
i would like to package an excel macro as an add-in to excel. the macro will reside on a central computer, where 10 other computers will connect to.
how do i create an add-in that will be constantly updated ?
According to this you can have an Add-In reside on a network share, so you wouldn't even need to bootstrap and update the code via code. Here's a quick rundown on how to create an Add-In.