|
-
May 6th, 2013, 08:25 AM
#1
Thread Starter
Frenzied Member
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
-
May 6th, 2013, 08:57 AM
#2
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.
-
May 6th, 2013, 09:23 AM
#3
Thread Starter
Frenzied Member
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..
-
May 6th, 2013, 09:26 AM
#4
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
Dim Path7 As String = Windows.Forms.Application.StartupPath
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 6th, 2013, 09:48 AM
#5
Thread Starter
Frenzied Member
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.
-
May 6th, 2013, 10:11 AM
#6
Re: Help with error - startup.path is not a member of microsoft.vbe.interop.applicati
Try
Code:
System.Windows.Forms.Application.StartupPath
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
-
May 6th, 2013, 10:15 AM
#7
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|