Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSH: Open and save unknown excel file.

Status
Not open for further replies.

Gadall

Programmer
Apr 21, 2008
18
US
I have a situation with a client, they receive an excel file from a 3rd party as a mail attachement, this file is saved to a particular directory and then imported into SQL using SSIS. The problem occurs however that the 3rd party has an Excel version 4.0 formatting macro embedded in the file, so when the file is opened, it is formatted, and hence "changed". This change, then makes excel want to save the file when working with it in SSIS, and since this process is run as a scheduled task, the process hangs until someone manually opens and then saves the excel file in place.

The SSIS process works if the manual open/save procedure is carried out. My question is, is it possible to automate this in some way? Bearing in mind the file is coming from a 3rd party so the adding of macro's/removing the formatting macro etc. are not feasible solutions at this time.


The reason the file is "unknown" is the file name changes based on time period and data within, the SSIS package accomodates this by using a for loop to run through .xls files in the particular directory these files are stored in.
 



Hi,

What do you think could be done in MS Office to address this issue? Don't you think that is it an SQL Server side issue? This might be better addressed in Forum183.

Skip,
[sub]
[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue][/sub]
 
Well I was kind of hoping there is a way in Windows Scripting Host to open and save the excel file, and I can add this script to a task schedule before running the SSIS task.
 


Again, Windows scripting is not MS Office.

You might try Forum329.



Skip,
[sub]
[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue][/sub]
 
um its scripting office actions .. and here I thought this forum might be helpful ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top