0

Excel マクロを実行する vb スクリプトを使用して、SSIS 2008 にパッケージをセットアップしました。Business Intelligence Development Studio (BIDS) 2008で動作しますが、それでも次のエラーが発生します。

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. 
at ST_e916156b0e6449b58e21905bd635ecf0.vbproj.ScriptMain.Main() 
--- End of inner exception stack trace --- 
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) 
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) 
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) 
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() 

また、SQL エージェントを使用してパッケージを実行すると、ジョブは成功しますが、マクロは実行されず、次のエラーが発生します。

Executed as user: 'myusername'. 
Code: 0xFFFFFFFF 
Source: Run macro script excel macro Description: Microsoft Excel cannot access the file 'book1.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. 
End Error 
DTExec: The package execution returned DTSER_SUCCESS (0). 
Started: 11:18:15 Finished: 11:18:19 
Elapsed: 3.775 seconds. 
The package executed successfully. The step succeeded. 

ただし、ローカル サーバーとネットワークに完全にアクセスでき、32 ビットと 64 ビットの両方で実行しようとしましたが、成功しませんでした。

この問題を解決するにはどうすればよいですか?

4

1 に答える 1

0

あなたが試すことができること:

私の個人的な経験では、SSIS を使用する場合、Excel は常に注意が必要です。エラー メッセージからわかるように、問題に関して次の情報を除外できることを確認します。

  • SQL Server エージェント サービスが実行されているユーザー アカウントを確認します。これを行うには、Windows Start\ Control Panel\ Administrative Tools\に移動しServicesます。という名前のサービスを探しますSQL Server Agent (<your instance name>)

  • アカウントが、Excel ファイルが保存されているフォルダーにアクセスできることを確認してください。

  • Excel ファイルを開いていないことを確認します。

  • SQL Server エージェントジョブで、パッケージを実行するステップをクリックします。タイプの下でパッケージを実行している場合は、タブでチェックSQL Server Integration Services Packageボックスがオンになっていることを確認してください。User 32 bit runtimeExecution options

  • パッケージ ファイル (.dtsx) を手動でダブルクリックすることもできます。これによりDTEXEC、パッケージを実行するユーティリティが表示されます。構成ファイルを使用している場合は、[構成] タブで構成ファイルを添付します。パッケージを実行します。資格情報の下でユーティリティで実行されDTEXEC、SQL Server エージェントの下では実行されない場合は、通常、関連する権限の問題であることがわかりました。

于 2013-02-21T14:57:47.653 に答える