Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with import module

Status
Not open for further replies.

Xsi

Programmer
May 29, 2015
121
SE
Hello people,

I get this error when I trying to import a myBasfile.bas module.


5orrs6T.png

KV8dIMZ.png

FII6nGx.png


here is my code

Code:
        Dim excelApp As Microsoft.Office.Interop.Excel.Application

        excelApp = New Microsoft.Office.Interop.Excel.Application
        excelApp.Visible = True
        excelApp.Workbooks.Add()
        Dim workingmodule As String
        Const vbext_ct_StdModule = 1
        excelApp.Visible = True

        workingmodule = excelApp.VBE.ActiveVBProject.VBComponents.Add(vbext_ct_StdModule).Name
        excelApp.VBE.ActiveVBProject.VBComponents.Item("Module1").CodeModule.AddFromString(My.Resources.MyBasfile)
        'excelApp.Run("Run_One")

Could someone help me?

Thank you in advance
 

In your code you have "Module1" but in Excel it is named "Modul1" (no 'e').

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top