Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
pk pk is offline
external usenet poster
 
Posts: 5
Default Pass a variable from a class module

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...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pass a variable from a class module

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.

--
Regards,
Tom Ogilvy


"pk" wrote in message
...
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...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating UDF by Class Module (Leo)? Leo Excel Discussion (Misc queries) 1 December 2nd 08 10:59 AM
CLASS MODULE & SIMPLE MODULE FARAZ QURESHI Excel Discussion (Misc queries) 1 September 7th 07 09:32 AM
What events can be captured in a Class Module? Tom Ogilvy Excel Programming 4 September 8th 03 05:41 AM
please give an example of a class module. Mike[_33_] Excel Programming 1 July 24th 03 07:27 AM
how to declare a class module Kevin Excel Programming 5 July 15th 03 01:04 AM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"