Results 1 to 3 of 3

how to get the return value from excel builtin methods

Threaded View

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    chennai, india
    MS-Off Ver
    Excel 2007
    Posts
    6

    how to get the return value from excel builtin methods

    hi,

    I am using the below code in my excel vba.

    ActiveWorkbook.Connections(1).ODBCConnection.Refresh
    I want to check from the program whether the refresh worked correctly. i just want to know whether it pops up error because of invalid username and password. i saw in the link http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.odbcconnection.refresh.aspx .

    If the refresh method didnt completed correctly then the method 'refresh' returns false. how can i assign that return value to a boolean variable.

    i tried like

    Dim fl As Boolean
    fl=ActiveWorkbook.Connections(1).ODBCConnection.Refresh
    it throws the compile error as type mismatch.


    please help me how to check whether refresh method works correctly.
    Last edited by JBeaucaire; 01-30-2013 at 04:31 AM. Reason: Added code tags, as per forum rules. Don't forget!

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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