Excel modifed date is changing when running package - ssis

I have a problem when loading data from excel source(excel 2010). When ever I run the package, the excel file modified date is changing to the current date. Even if I change the excel connection properties also, the file modified date is changing. How can I resolve this issue? I am using Dataflow task and excel source.

I could not find any other solution than setting read-only attribute on Excel and PowerPoint files to avoid that Excel (2010, 2007, 2003) and PowerPoint (2010, 2007, 2003) modify the binary data stream of the file without changing last modification date on just opening the file for reading and closing without making any change and therefore without explicit save.
I could see on comparing the binary files (*.xls, *.pps) before and after viewing the Excel/PowerPoint file with last modification date unchanged, but byte stream changed with (PowerPoint) or without (Excel) a change of file size, that those 2 applications from the Microsoft Office package always record in the file the name of the user who last opened the file, even when the file was not modified at all.
Microsoft Word (2010, 2007, 2003) does not modify the byte stream of *.doc files on just opening the document for reading. I could see this behavior only on Excel and PowerPoint.
I have not tested if other versions of Excel and PowerPoint than from Office 2010, 2007, 2003 make changes on file contents on just opening the file for viewing.
I would be really interested in if there is a registry value which could be set to avoid the modification of Excel and PowerPoint files on just viewing them.
See also How to prevent Excel from modifying the file on exit?

Related

SSIS Error Importing XLS File - External table is not in the expected format

I'm trying to open the following XLS file in SSIS:
https://drive.google.com/file/d/1E_fNSlRTMuoYnH7VERFB8hXbcxssKSGr/view?usp=sharing
I can open it in Excel, without any error or warning from Excel.
But When I try to open it in SSIS or even In PowerBi, I get the following message: "External table is not in the expected format". If I open it in Excel and then Save again in the same XLS format, I can open it in SSIS.
I've installed the following OLE DB Drivers:
AccessDatabaseEngine_X64 (x64)
AccessDatabaseEngine (x86)
And I've tried with the following providers:
Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=Excel 12.0;
Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=Excel 8.0;
Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;
Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 5.0;
Any idea about why the file is not opening in SSIS?
I don't want to be opening every file, every day, because there are many files every day that I need to load.
I'm using Visual Studio 2019 with projet compatibility for SSIS 2017.
Thanks!
The first issue that the excel reader is going to have is the image sitting there throws the tooling off. As soon as I deleted the image and saved it, the tooling started to work.
The next problem you're going to run into is that you need to skip the first N rows before your data begins. Since there's no functionality in the JET driver to do that, you're going to need to do some magic to work with the data set.
Google the terms Excel, IMEX and registry keys and you'll get into the voodoo of Excel type inference (based on the first 8 rows) and it's ugly.
At this point in my career, I either push back and ask for a cleaner extract of data from the provider. Otherwise, I increase the estimate and write a custom Script Component Source that uses the JET/ACE drivers to extract the data and then shape and type the data into my data flow.

Distinguish between renamed .accde file and .accdb file

I have been given an Access database .accdb file by a client to work with. When I open it and try to open a code or form design window, it reports that it is an .accde file (with no code). Is there a way (with a hex editor, for example) that I can prove to my client that this is a renamed .accde file, not an .accdb?
Make a copy of the original file, and save it as an accde file.
Create a new small database with just a splash screen and save it as an accdb file.
Copy that file, and then convert it to an accde file.
Schedule a 15 minute meeting with your boss and show him all 4 files.
Unless he just fell off a turnip truck, he's going to see the difference between when an accdb and accde file open (i.e. your newly created files), and see that the original accdb file opens with the exact same message as your accde copy and your newly created accde.
If he can't put 2 and 2 together, schedule a meeting with his supervisor and ask for his job.

SSRS-Export ToExcel-without MS office on client

SSRS Question: What will happen if a client machine does not have MS Office installed on it and a SSRS report's "Export to EXCEL/WORD" functionality produces on excel report? One possibility is the file will get saved on client machine but one can not open it in excel format. What is the solution to overcome this issue? Can we do something from server side?
You are correct - the report will export to Excel or Word, and the client would then be unable to open the file. If you want to open an Excel file, you will need something that can read the file format. Open source office solutions could work, as could Microsoft's Office Viewer applications, or even a converter tool that converts the file to another format.
Alternatively, could you just export to a format that IS accessible on the client machine? CSV, tab delimited, HTML, etc?

how to export datagrid to excel(.xlsx format only) without using server side technology and as3xls?

Presently I am using as3xls.swc to export datagrid to excel which is giving me only to save as .xls format which is opening in microsoft excel 2010 which is OK for me, but it is only opening in protected mode where I am unable to do any edits or save it. So, can anybody know any other way to save as .xlsx format in the client side itself?
Protected mode is a feature of Excel within the Microsoft operating system. They're trying to keep you from inadvertently downloading viruses. You can defeat these measures by modifying the Excel trust store. It has nothing to do with your code, and you don't need to use older versions of Excel.
I find it easiest to add a trusted location (like your desktop).
http://office.microsoft.com/en-us/excel-help/what-is-protected-view-HA010355931.aspx
You can export to Excel2007 - its just an xml file format. WE have some details on our blog: http://blog.flexicious.com/post/Flexicious-30-Release-Grid-Edition.aspx. Keep in mind however, it generates an XML file, which when you double click on, will correctly open up excel (Assuming you have excel 2007 or the reader installed).

Print MS Access report to .xps file using VBA

I am using MS Access 2003 and have seven different reports I have to distribute each morning, and I currently do that manually by printing each to an XPS file. The default printer for each report has been set to XPS file, and I tried this code:
DoCmd.OpenReport ("rptDaily_1of7")
DoCmd.PrintOut acPrintAll,1,,acHigh,1
When I use that, it does open a Save As box, but .tif is the only option in the "Save As type" field. Even if it wasn't though, ideally I'd like to send the file path and name as a parameter and have it handle the entire process (so I can use a loop to generate all seven files with the push of a button). I'm hoping there's another command I can use to do this, or possibly another method. Note that it's not my machine, and I do not have admin rights to install anything else (like a pdf generator, etc.).
You can create your reports as PDF files using ReportToPDF by Stephen Lebans.
This can be easily automated (there is a MDB with example code in the download) and you don't have to install anything.
It comes with two DLLs which you need to put into the same folder as your MDB/MDE, and that's it. No installation / DLL registering, just distribute the two DLLs with your MDB/MDE.
We are using this at work to print thousands of reports per day from Access 2003.