Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Importing Excel File Password Protected with DTS

Author  Topic 

jdoering
Starting Member

32 Posts

Posted - 2002-11-06 : 13:36:26
Hello,

I am currently working in SQL Server 2000. I am trying to import an Excel workbook that is password protected. I keep receiving the error: "Cannot Start Your Application. The workbook information file is missing or opened exclusively by another user".


I have written an activeX script within my DTS package to change the name of the Excel source file based on the variable that is passed into the DTS package. In addition, I have performed a Disconnected Edit and typed in the password of the Excel spreadsheet. Below is my ActiveX code:

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()

Dim oPKG
Dim oConn


' Gain Reference to the Package Object
Set oPKG = DTSGlobalVariables.Parent

' Gain reference to the Text Connection by Name
Set oConn = oPKG.Connections("Microsoft Excel 97-2000")


' Set DataSource (Filename) property to Global Variable
oConn.DataSource ="E:\eCsConnect\LoadTemplate_Lite_V12_" & DTSGlobalVariables("@Supplier_ID").Value & ".XLS"
Main = DTSTaskExecResult_Success

End Function

Any suggestions would be appreciated.

Thanks,
Julie



Edited by - jdoering on 11/06/2002 13:40:48

Tim
Starting Member

392 Posts

Posted - 2002-11-06 : 21:32:04
how is the workbook protected, that is, w Which protection option is used?



----
Nancy Davolio: Best looking chick at Northwind 1992-2000
Go to Top of Page

jdoering
Starting Member

32 Posts

Posted - 2002-11-07 : 13:25:10
The protection option for Excel is just Workbook protection using a password, not worksheet protection.

Thanks,
Julie

Go to Top of Page
   

- Advertisement -