Results 1 to 7 of 7

Thread: Help with error - startup.path is not a member of microsoft.vbe.interop.application

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Exclamation 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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    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..

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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!

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    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.

  6. #6
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    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

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width