+ Reply to Thread
Results 1 to 5 of 5

Declaring function in VBA

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016
    Posts
    560

    Declaring function in VBA

    Hi Guys,

    i have function in VB like this:

    Please Login or Register  to view this content.
    i am trying to move this to VBA.

    It is possbile to delcare functions like above in VBA?
    I mean first IF here...
    fHandleFile opens ANY file with the default application.

    Best,
    Jacek
    Last edited by jaryszek; 07-11-2018 at 05:46 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    18,310

    Re: Declaring function in VBA

    Jacek

    What's the purpose of the code?

    PS Are you sure it's VB code? Looks kind of like Access VBA code to me.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016
    Posts
    560

    Re: Declaring function in VBA

    This is access VBA code.

    But it is very strange for me.
    And it is not working.

    Best,
    Jacek

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003, 2007, 2010 & 2013
    Posts
    18,094

    Re: Declaring function in VBA

    What does 'not working' mean exactly?

    You would need to comment out the Option Compare Database line.
    You would need to comment the ####### line
    You would need to change the argument hWndAccessApp to use the excel application handle, Application.hWnd

    If it still 'does not work' provide more detail
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016
    Posts
    560

    Re: Declaring function in VBA

    thank you very much,

    working !

    Best,
    Jacek

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1