+ 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-365
    Posts
    2,940

    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
    19,643

    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-365
    Posts
    2,940

    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
    O365
    Posts
    20,419

    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-365
    Posts
    2,940

    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)

Similar Threads

  1. Declaring variables
    By hei.so in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2018, 03:01 PM
  2. Replies: 42
    Last Post: 06-15-2016, 11:07 AM
  3. Declaring string in R1C1 with Rank function?
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2013, 04:36 PM
  4. declaring a variable
    By squeekee35 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-06-2011, 03:36 PM
  5. Declaring
    By Stuie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2006, 12:52 PM
  6. declaring a certain value
    By thephoenix12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2005, 12:05 PM
  7. [SOLVED] Excel2000: Declaring function parameter as an array
    By Arvi Laanemets in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2005, 09:06 AM

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