Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel prompts for VBApassword after saving workbook under new name and exiting excel

Can anyone please advise. Excel prompts for VBA Password after saving
workbook under a new name and exiting excel

The issue looks to be being cause by the following code:

Sub LoadCombo(strSQL As String, comboName As Object)
Sheets("Data").Visible = True

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strFile As String
Dim psDrop As Variant
Dim strCon As String
strFile = Workbooks(1).FullName

strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFile _
& ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"

Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

cn.Open strCon
rs.Open strSQL, cn

psDrop = rs.GetRows
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing



With comboName
.Clear
.BoundColumn = 1
.List = Application.WorksheetFunction.Transpose(psDrop)
'.ListIndex = -1
.ListIndex = 0
.Value = .List(0)
If comboName.Name < "cmbSport" And comboName.Name < "cmbClass"
Then .AddItem "N/A"
End With

Sheets("Data").Visible = xlVeryHidden

End Sub


This is stored in a module and is called from a form to populate a combo

Sub UserForm_Initialize()

Dim strSQL As String

Application.ScreenUpdating = False

'load Standard of Presentation
strSQL = "SELECT code FROM LDCLookUp Where (Category='LDC Presentation
Standard') AND (status='Active') ORDER BY [Order]"
LoadCombo strSQL, cmbStdOfPresentation

................
LDCLookUp is a range on the sheet called Data



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
exiting excel ONLY the workbook will close Brandon Excel Discussion (Misc queries) 12 May 27th 10 09:59 PM
Buttons for saving and exiting a workbook zak Excel Programming 2 January 14th 09 02:23 PM
How do I turn off saving. when I'm exiting an excel worksheet [email protected] Excel Discussion (Misc queries) 1 January 31st 06 04:22 PM
When saving CSV excel always prompts about the file format SimonW-UK Excel Discussion (Misc queries) 2 November 16th 05 10:34 AM
Exiting Excel prompts for save MXH Excel Discussion (Misc queries) 3 February 22nd 05 08:31 PM


All times are GMT +1. The time now is 09:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"