Hi,
I'm Using DAO to connect CR & Excel file.
From Vb,I have to pass file location, for that I'm using the following code...
VB Code:
  1. crDoc.Load(RptName)
  2.         crTables = crDoc.Database.Tables
  3.         For Each crTable In crTables
  4.             crTable.Location = BookLocation
  5.         Next
  6.  
  7.         c = crDoc.Subreports.Count
  8.         For i = 0 To c - 1
  9.             SubDoc = crDoc.Subreports.Item(i)
  10.             SubTables = SubDoc.Database.Tables
  11.             For Each SubTable In SubTables
  12.                 SubTable.Location = BookLocation
  13.             Next
  14.         Next
It is working fine...Now I want to protect the Excel file with password..
How can i pass the password to the Crystal Report..any idea??
I tried as follows...but got error...
VB Code:
  1. Dim myLogin As TableLogOnInfo
  2.  
  3.             For Each crTable In crTables
  4.                 myLogin = crTable.LogOnInfo
  5.  
  6.                 With myLogin.ConnectionInfo
  7.                     .DatabaseName = BookLocation
  8.                     .UserID = "Admin"
  9.                 End With
  10.  
  11.                 crTable.ApplyLogOnInfo(myLogin)
  12.             Next
BUt it gives error as :
Logon failed
Unable to connect: incorrect logon parameters


And, I read somewhere that, if DAO is used for coneection then the ApplyLogonInfo method will not work..Is it True?...

I'm struck with this problem...i've to finish this by this week...Help me,quickly