I'm using SQL Server 2008 and I am dumping data into Excel using OPENROWSET.
Let's call that the "EXCEL DUMPFILE". I have set up multiple Excel files that reference data from the "DUMP FILE". Every time people go into the Excel files to use them the data is not pulling thru from the "EXCEL DUMP FILE" because the DUMP FILE isn't open. Barring creating a script in SQL to open all the files up and refresh and save is there something I can do to make this automatic so that we don't have to have any intervention for people to get the most current data?
Thanks
Related
I have a requirement in which i need to send the ETL data report with actual added, updated and deleted records in a excel.
Excel will be having 3 sheets. ie: Inserted, Updated and Deleted.
Im able to create required sheets in the Excel file and through execute SQL tasks.
Once the tabs are created, im even able to push the data into the respective sheets.
the file generation is successful as i expect. But, the problem is while opening the file. I get an error as shown below.
Excel FIle Generated from SSIS cannot be accessed. the file may be corrupted, located on a server that is not responding, or read only.
I'm trying to change some Excel Files which are laying on SharePoint.
This should be performed automatically while my Import to SQL-Server is running. For the Import I'm using a SSIS.
Is it possible to change Excel Files with SSIS? And hwo is it possible?
By the way the SSIS package should open and close the the Excel files so that I got no interferences through open packages.
I'm Using Excel 2013, SQL-Server and Visual Studio 2013
You can use the following code to open Excel-Files on SharePoint:
Dim process As New System.Diagnostics.Process()
process.Start("filepath")
process.Close()
If you get the Excel- File as .xlsm file you can directly process the macro. If you get an .xlsx- file you need to make an extra file which can process macros and then you process the new file.
I develop an application in VB6 and my data source is Excel 2007. And I have created 2 reports in Microsoft Data Report Designer.
My program is working. I can save data (update)in excel file and view existing data via VB6. And I have written code to backup (copy paste) the excel file in another folder. This is also working as I wanted.
But after I open or view the DataReports, I cant save the data in the Excel and backup the excel file. Then I will have to close the application to update and backup excel sheet.
When I try to save data in Excel file after viewing the report I receive the message
The excel file already exists
When I try to backup after viewing and closing the report I receive the error message
Run time error 70" Permission denied
Need help please.
I'm running into a strange issue when trying to load excel spreadsheets into my database through SSIS (2012).
I'm getting the spreadsheets (which are xlsx files) via email, and then I manually save them to my local drive (C:\temp). When I try to use the excel file as a source in SSIS, I am not able to pick any excel sheets in the book.
The file is not corrupted, not open on my machine, and not password protected. It is, however, opening in Protected View. So I go into Excel and turned off all the Protected View options, but no cigar. The only way I am able to use the file as an excel source in SSIS is by opening it, and saving over it.
Does anyone have a similar experience? Other than opening and saving all of the files manually, is there a better solution?
It's a known issue with xml based excel (xlsx). If you can save them as xls, that will solve the problem. If for some reason that's not possible you may need to use OLE source to read them.
I have a few Excel files (Pivot Tables & Charts) that have a data connection to an Access database. What I'm hoping to do is have them automatically refresh and get emailed on the 1st of each month.
I do something similar in Access, where I have a database with a query that gets run and emailed. I accomplished this by creating a form in the database, having the form open automatically when the database is opened, and then used VBA within the form to run the query (DoCmd.OpenQuery) and then email it (DoCmd.SendObject)
Can I do something similar with an Excel file? I'm thinking I could set the Connection Properties under the Data tab to "Refresh data when opening the file", but that assumes the user has an active network connection as the database is on a server. Also, if the user saves the file and opens it again in the future, it will have current data and not the original data.
So in a nutshell I need to:
Open Excel File
Refresh Data
Email File
Here's what I ended up doing:
In Access, I have some Make Table queries that make tables (duh) which will be used by the Excel files. I created a form, have it open automatically when the database opens, and in the Form_Load() event I put the following:
With DoCmd
.SetWarnings False
.OpenQuery "My Query 1"
.OpenQuery "My Query 2"
.SetWarnings True
End With
Application.Quit
In each Excel file, I found some VBA code online to create a PDF and then email it. In the Workbook_Open() event, I have the following:
ActiveSheet.Unprotect
ActiveWorkbook.Connections("MyConnection").Refresh
ActiveSheet.Protect
Call FunctionThatCreatesPDFAndEmails
ActiveWorkbook.Close False
I then put some tasks in Windows Task Scheduler .. one to open the Access database (which causes the Make Table queries to run and then closes itself) and then one task for each Excel file that I need to update and email. So now I have Access updating the source data tables, and then Excel opening each file, refreshing the data, and emailing a PDF of itself. Mission Accomplished!