|
|
|
не закрываеться Эксель
|
|||
|---|---|---|---|
|
#18+
вот весь код: до начало использования кода эксель не загружен!!! Private Sub lsql_Click(Index As Integer) Dim XLAPP As Excel.Application Dim xlBook As Excel.workbook Dim xlSheet As Excel.Worksheet 'Dim cmd As New ADODB.Command Dim prm As ADODB.Parameter Dim rst As New ADODB.Recordset Dim kolvo As Integer Dim login As String 'Âûïîëÿåì õðàíèìóþ ïðîöåäóðó ïî âûãðóçêå â ÍÄ áàçû Set cn = New ADODB.Connection cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=test;Initial Catalog=To_Prov;Data Source=PH48" Set cmd = New ADODB.Command cmd.ActiveConnection = cn cmd.CommandText = "qwe" cmd.CommandType = adCmdStoredProc cmd.CommandTimeout = 15 kolvo = InputBox("1") login = InputBox("2") With cmd .Parameters.Append .CreateParameter("@q", adInteger, adParamInput, 3, kolvo) .Parameters.Append .CreateParameter("@l", adVarChar, adParamInput, 100, login) End With Set rst = cmd.Execute() Set XLAPP = New Excel.Application XLAPP.Visible = True Set xlBook = XLAPP.Workbooks.Add 'With XLAPP.Workbooks.Add Set xlSheet = xlBook.Sheets(1) ' êîïèðàâîíèå ÍÄ â ýêñåëü For iCols = 0 To rst.Fields.Count - 1 xlSheet.Cells(1, iCols + 1).Value = rst.Fields(iCols).Name Next xlSheet.Range("A2").CopyFromRecordset rst 'Ñîõðàíåíèå ActiveWorkbook.SaveAs FileName:=App.Path + "\data\prov.xml", FileFormat:= _ xlXMLSpreadsheet, ReadOnlyRecommended:=False, CreateBackup:=False rst.Close Set rst = Nothing xlBook.Close False XLAPP.Quit Set rst = Nothing Set xlSheet = Nothing Set xlBook = Nothing Set XLAPP = Nothing MsgBox ("5") End Sub ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.04.2006, 15:58 |
|
||
|
не закрываеться Эксель
|
|||
|---|---|---|---|
|
#18+
и еще забыл, он закрываеться тока из процессов не вылазиет) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.04.2006, 16:03 |
|
||
|
|

start [/forum/topic.php?fid=60&msg=33671716&tid=2166025]: |
0ms |
get settings: |
8ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
170ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
43ms |
get tp. blocked users: |
1ms |
| others: | 259ms |
| total: | 507ms |

| 0 / 0 |
