Help with error - startup.path is not a member of microsoft.vbe.interop.application
Hello,
I created a winform project that uses the following imports:
Code:
Imports Office = Microsoft.Office.Core
Imports Microsoft.Office.Interop
Imports Microsoft.Vbe.Interop
Imports System.Data.OleDb
Imports System.Data
Imports System.IO
Imports System.Net
In one routine I try adding the following line that is used in my other winform app and I get the error startup.path is not a member of microsoft.vbe.interop.application.
Code:
Dim Path7 As String = Application.StartupPath
I am also trying to run the exe on the windows server scheduler but it is hanging and not doing what it is supposed to. It will run fine when I run it myself manually. All my other apps runs fine on the scheduler but none of them uses the imports like this one and uses the Excel.Application in it.
Thanks,
Warren
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
You have a name clash. You have two Application classes that can be accessed unqualified based on your namespace imports and the one mentioned in the error message is taking precedence. You'll need to qualify the Application class with its namespace, i.e. System.Windows.Forms.Application, to ensure that it is interpreted as the right one. You can actually leave off the System if you like. I'm not 100% sure of this but I would assume that file-level imports take precedence over project-wide imports.
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
Thanks for the reply. I'm sorry but I'm a little lost on what I need to do.
Sorry..
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
Dim Path7 As String = Windows.Forms.Application.StartupPath
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
When i change the line to that it says Forms is not a member of Microsoft.Vbe.Interop.Windows.
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
Try
Code:
System.Windows.Forms.Application.StartupPath
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
Remove this: Imports Microsoft.Vbe.Interop - it's interfering with some of the base namespaces...
-tg