Pass a variable from a class module

P

pk

Perhaps, Tom Ogilvy or someone could help me with this,
please?

I am attempting to pass a variable (a date, right now a
variant: should I change this?) from a public sub in a
class module (a sheet module) in one file to a subroutine
residing in another file.

It isn't working. Is it not possible or am I missing the
boat? Here is the code in the sheet module:

Public Sub Calendar1_DblClick()
xDate = Calendar1.Value
ActiveSheet.OLEObjects("Calendar1").Delete
Application.Run "Calendar!Common_Receive_Date(xDate)"
End Sub

The objective is to pass the date from the calendar
control to the other file and simultaneously kick off a
program there. Possible?

Thanks in advance for your example code and assistance...
 
T

Tom Ogilvy

Application.Run "Calendar!Common_Receive_Date", xDate

Arguments to run are the macro to run, then a list of argument values for
that macro.

I don't know how successful you will be deleting the calendar control from
an event of the calendar control.

I think I would move that line to the end and probably comment it out for
testing the run command - until I was sure the run command was working.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top