zhuravsky
Russia
115 Posts |
Posted - 04/30/2008 : 10:53:10
|
Например, так:
Option Explicit
Private Sub Document_DocumentOpened(ByVal doc As IVDocument) Dim ExcelApp As Object Dim FName As Variant Dim S As Variant Dim I As Integer ' On Error GoTo ErrHandler FName = "D:\Temp\File.xls" Set ExcelApp = CreateObject("Excel.Application") ExcelApp.Workbooks.Open FName S = "" I = 1 ComboBox1.Clear Do S = ExcelApp.Cells(I, 1) If Len(S) > 0 Then ComboBox1.AddItem S I = I + 1 End If Loop Until Len(S) = 0 ErrHandler: ExcelApp.Quit Set ExcelApp = Nothing End Sub
Sub Test() Document_DocumentOpened ThisDocument End Sub
Visio 2003, Excel 2003 Подставьте своё имя файла в переменной FName |
|
|