Click here to Skip to main content
15,901,122 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Test for NUMERIC values Pin
Christian Graus20-Oct-09 21:19
protectorChristian Graus20-Oct-09 21:19 
GeneralRe: Test for NUMERIC values Pin
dan!sh 20-Oct-09 21:14
professional dan!sh 20-Oct-09 21:14 
AnswerRe: Test for NUMERIC values Pin
_Damian S_20-Oct-09 18:33
professional_Damian S_20-Oct-09 18:33 
GeneralRe: Test for NUMERIC values Pin
Ashfield21-Oct-09 1:37
Ashfield21-Oct-09 1:37 
QuestionSharing SAPI Speech Objects Pin
wheeldog9920-Oct-09 14:52
wheeldog9920-Oct-09 14:52 
AnswerRe: Sharing SAPI Speech Objects Pin
Mycroft Holmes20-Oct-09 16:32
professionalMycroft Holmes20-Oct-09 16:32 
GeneralRe: Sharing SAPI Speech Objects Pin
wheeldog9921-Oct-09 9:26
wheeldog9921-Oct-09 9:26 
QuestionCalling cell address - Excel UDF in a DLL Pin
Hathome20-Oct-09 9:51
Hathome20-Oct-09 9:51 
Hi,

I have several Excel UDFs in a DLL created with VB (VB2008 Express) and .NET 3.5 SP1
My existing UDFs in this DLL work fine when called from Excel (2003).

I am now trying to add a new UDF that requires the name of the workbook and worksheet of the cell calling the UDF.

I cannot get the ActiveCell or the Application.Caller functions to work. I have searched for some time and tried various methods, but Intellisense always shows that they are wrong and when built, re-registered, and accessed from my test function =XTest(A1) they (not surprisingly) return an error.

I have :
Option Infer On
Option Strict On
Option Explicit On

and the following Imports:
Imports System
Imports System.Math
Imports System.Runtime.InteropServices
Imports XL = Microsoft.Office.Interop.Excel

The following references are used (possibly more than I need, but I have tried various routes to get this to work):
Microsoft Excel 11.0 Object Library
Microsoft Office 11.0 Object Library
Microsoft Windows Common Controls 6.0 (SP6)
OLE Automation
System.dll
System.Core.dll
System.Data.dll
System.Data.DataSetExtensions.dll
System.Runtime.Remoting.dll
System.Xml.dll
System.Xml.Linq.dll
Microsoft Visual Basic for Applications Extensibility 5.3

I have an Interface section, which includes a test UDF I am using to try and access the calling cell's address, workbook and worksheet's names:
 <InterfaceType(ComInterfaceType.InterfaceIsDual)> _
Public Interface ComIF
   'test function
    Function XTest(ByRef XTRange As XL.Range) As Object

and the public class with the function code:
' Class that implements the Interface
<Guid("9FEB08E8-B561-4e9e-9990-C73D02B206C5"), _
ClassInterface(ClassInterfaceType.None), ProgId("HumarFunctions.Functions1")> _
Public Class Functions1 : Implements ComIF

   Public Function XTest(ByRef XTRange As XL.Range) As Object Implements ComIF.XTest
        On Error GoTo MyErr

<various bits of code to try and return the calling cell address
none of which work !>

        Exit Function
MyErr:
        XTest = CVErr(CVErrEnum.ErrNA)
    End Function
End Class

Any advice on how to access the active cell or the calling cell, or pointers to suitable articles or posts would be much appreciated.

Regards
Question[Message Deleted] Pin
quadrilateral20-Oct-09 8:29
quadrilateral20-Oct-09 8:29 
AnswerRe: SAPI SDK Voices Pin
Richard MacCutchan20-Oct-09 9:08
mveRichard MacCutchan20-Oct-09 9:08 
AnswerRe: SAPI SDK Voices Pin
Christian Graus20-Oct-09 13:04
protectorChristian Graus20-Oct-09 13:04 
QuestionCopy Data from Excel into a Data Grid View Pin
Alex Lush20-Oct-09 6:34
Alex Lush20-Oct-09 6:34 
AnswerRe: Copy Data from Excel into a Data Grid View Pin
dan!sh 20-Oct-09 6:52
professional dan!sh 20-Oct-09 6:52 
GeneralRe: Copy Data from Excel into a Data Grid View Pin
Alex Lush21-Oct-09 3:17
Alex Lush21-Oct-09 3:17 
QuestionRichTextBox Contents [Texts, Table] To Email - Body () Pin
Paramu197320-Oct-09 0:02
Paramu197320-Oct-09 0:02 
AnswerRe: RichTextBox Contents [Texts, Table] To Email - Body () Pin
Ashfield20-Oct-09 1:57
Ashfield20-Oct-09 1:57 
GeneralRe: RichTextBox Contents [Texts, Table] To Email - Body () Pin
Paramu197320-Oct-09 2:31
Paramu197320-Oct-09 2:31 
GeneralRe: RichTextBox Contents [Texts, Table] To Email - Body () Pin
Ashfield20-Oct-09 9:11
Ashfield20-Oct-09 9:11 
QuestionHow to Insert a Table from MS-Word Document to Email-Body ? Pin
Paramu197319-Oct-09 23:49
Paramu197319-Oct-09 23:49 
AnswerRe: How to Insert a Table from MS-Word Document to Email-Body ? Pin
Eddy Vluggen20-Oct-09 13:45
professionalEddy Vluggen20-Oct-09 13:45 
QuestionHow to open a cash drawer using VB6 Pin
mwith19-Oct-09 21:49
mwith19-Oct-09 21:49 
AnswerRe: How to open a cash drawer using VB6 Pin
annathor19-Oct-09 22:17
annathor19-Oct-09 22:17 
AnswerRe: How to open a cash drawer using VB6 Pin
Mycroft Holmes19-Oct-09 22:52
professionalMycroft Holmes19-Oct-09 22:52 
AnswerRe: How to open a cash drawer using VB6 Pin
Christian Graus20-Oct-09 0:10
protectorChristian Graus20-Oct-09 0:10 
AnswerRe: How to open a cash drawer using VB6 Pin
The Man from U.N.C.L.E.20-Oct-09 4:41
The Man from U.N.C.L.E.20-Oct-09 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.