Home > Software engineering >  Vb DLL
Vb DLL

Time:10-25

I want to use vb to write the main program to convey a excel file path to vb DLL, the code is as follows:
Dim F As String 'excel spreadsheet address'
'd="c: \ 1. XLS"'
D=Text2. The Text in the Text box input the address of the excel file and then call the DLL, the DLL's code is as follows:
Dim xlApp As Excel. Application 'Excel import data, Excel objects'
Dim xlBook As Excel. The Workbook 'book'
Dim xlSheet As Excel. The Worksheet 'Worksheet'
Dim Filename, SheetName As String
Filename=d
SheetName="sheet1" 'table'
The Set xlApp=CreateObject (" Excel. Application ") 'create Excel object'
Set xlBook=xlApp. Workbooks. Open (Filename) 'Open existing EXCEL artifacts book file
The Set xlSheet=xlBook. Worksheets (SheetName) 'sets the active worksheet'
XlApp. Visible=True 'set the EXCEL object Visible'
In the DLL using Filename=d receiving address the error 1004 could not find file warrior advice please

CodePudding user response:

Vb to write a DLL, registered after the references,
Main program calls the DLL in class, give a kind of function parameters will write
  • Related