|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 11:04 AM
Points: 83,
Visits: 50
|
|
Hi All -
First let me tell you what my SSIS package does,
SSIS Package: -
As per the business requirement, i have to run the Excel & Access Macro's thru SSIS package. So, what i did is, i have created the .vbs scripts and trying to executing them through SSIS package but unable to succeed becasue of the following error
Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. NULL C:\LCSP Applications\Alcspscript.vbs(6, 1) Microsoft Office Excel: Microsoft Office Excel cannot access the file 'C:\LCSP Applications\partner_email.xls'. There are several possible reasons: NULL The file name or path does not exist. The file is being used by another program. The workbook you are trying to save has the same name as a currently open workbook. NULL NULL
But the interesting thing is, if i run those .vbs scripts just by double clicking them its working fine.
Note: - I have enabled the "xp_cmdshell" command also.
Any ideas will be greatly appreciated.
Many Thanks in Advance.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 1:52 AM
Points: 9,372,
Visits: 6,469
|
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:46 AM
Points: 240,
Visits: 653
|
|
Why is the business requirement to run macros thru SSIS?? That's odd, to say the least. However, I have had stranger things dictated to me ...
If you really need this vba code, use a script component in a data flow. That uses VSA, and VBA is a very close match to it. not perfect, you'll have editing to do.
Otherwise, unless there are significant reasons not to, I would recreate the macro actions is SSIS if data tranforms and loading are part of the project. If you aren't moving data, I'd question why you "have to" use SSIS if you already have the macros.
More info, please.
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 4:33 AM
Points: 4,239,
Visits: 9,483
|
|
Notwithstanding the fact that SSIS is the wrong tool - ditto comments already made ...
Have you investigated the 'Execute Process' SSIS task - this might run the .VBS scripts (never tried, but worth a shot).
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, January 28, 2013 11:03 AM
Points: 2,
Visits: 12
|
|
Did you get this resolved? I need to do something similar but am getting the same error. I had the code working on an xp machine running ss 2005 but now that I upgraded to Server 2012 and ss 2012, I get this error. I can also run the vbs file from windows directly and it runs fine, just fails when I run it in SQL Server. Thanks, Mike
EXEC XP_CMDSHELL 'CScript C:\folder\VBScript\DXPETE7.vbs' Results below: Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. C:\folder\VBScript\DXPETE7.vbs(4, 1) Microsoft Excel: Microsoft Excel cannot access the file '\\servernm\c$\folder\archive\DXPETE7.xls'. There are several possible reasons: The file name or path does not exist. The file is being used by another program. The workbook you are trying to save has the same name as a currently open workbook.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 4:11 PM
Points: 1,033,
Visits: 2,593
|
|
For both of the posters asking about this, I'm going to second Phil's earlier comment. If you're using SSIS for ETL, don't use xp_cmdshell to fire executables against the operating system. The Execute Process Task is a much better tool for this.
Tim Mitchell SQL Server MVP www.TimMitchell.net twitter.com/Tim_Mitchell
|
|
|
|