Results 1 to 6 of 6

Thread: [RESOLVED] Set the dynamic path Syntax help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    159

    Resolved [RESOLVED] Set the dynamic path Syntax help

    Hi experts;
    I ahave a excell sheet. for trying the code i set the path like
    objWrkBk = GetObject("C:\ABC.XLS")
    Now i want that when i publish the project include this XLS file.
    I copy the file in resources folder and give path as
    objWrkBk = GetObject("/Resources/abc.XLS")
    But exception occur.
    Where i include the file which becomes the part of the application?
    PLz guide me
    Thanks

  2. #2

    Re: Set the dynamic path Syntax help

    What's the exception? I'm going to assume it's a file not found but I could be wrong. I'm also going to suggest you look into using Application.StartupPath() and IO.Path.Combine().

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    159

    Re: Set the dynamic path Syntax help

    Hi;
    Exception as shown in image
    Attached Images Attached Images  

  4. #4

    Re: Set the dynamic path Syntax help

    That's a different error that I know how to fix. Did you try anything I suggested or looked into anything I posted?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    159

    Re: Set the dynamic path Syntax help

    Yes i try and read ur link;
    The startup path is as follow
    c:\Hamad'documents\visualsudio2008\project\gas turb calc\bin\debug

    but when i publish or make exe for i want to include that excell file with it.
    User may be install the project in D drive then?
    Thats why i want to understand where i put the excell file which include at the time of publishing/exe and when user install it works without any error.
    Thanks for help
    Regards

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    159

    Re: Set the dynamic path Syntax help

    Hi;
    when i write as
    C:\Documents and Settings\Hamad Sultan\My Documents\abc.xls
    then no exception occur.
    Plz help me i can not understand how i fix it?
    Regards

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