troubleshooting Question

control forms from vb module

Avatar of mellenf
mellenfFlag for Australia asked on
.NET ProgrammingVisual Basic.NETMicrosoft Development
7 Comments2 Solutions312 ViewsLast Modified:
Using visual Studio 2005 programming in visual basic.
I have one module and two forms. The program launches the setupform, which
sets global variables in the mainmodule. After completion it hands control to mainmod.
The second form (monitor) now needs to be shown and is updated every minute.
The program runs 24/7, but there has to be a way to stop it, which is done by a checkbox on the monitor form.

The problem is I cannot control the forms from the module.
Following is some code from the module:

Imports System
Imports System.Collections
Imports Microsoft.Office.interop.excel

Module MainMod

'       global variables
    Dim FMXL As Excel.Application
    Dim FMWbook As Workbook
    Dim FMWSheet As Worksheet
    Dim FMMon1 As New System.Windows.Forms.Form
    Dim FMSet1 As New System.Windows.Forms.Form
                           etc

    Sub Main()

        FMSet1.Name = "SetupForm"
        FMMon1.Name = "MonitorForm"

        FMSet1.Close()
        FMMon1.Show()
         etc

The problem is, it is not complaining about the syntax, but FMMon1.show show a completely blank form, not the monitor form I have created.
Also there is a public subroutine in MonitorForm, but is does not show up in FMMon1.
In addition I cannot close or unload the setupform

So we are obviously not connected.
Can you tell me what is wrong or missing.

Another thing I have a problem with is to set the location of the monitor form. There are 5 radio buttons on the form sending the form top left, centre etc
However to set location pointer with X & Y coordinates escapes me.

I do a lot of programming in VBA and I find this visual studio very tedious & frustrating.
For example I cannot use Range(Cells(1,1),Cells(5,2000)).Select
Nor can it understand EntireColumn etc etc
and I have not tried ActiveCell.offset, but probably not. (I have not seen it in intellisence)
Can anybody "open a door here"?

Can somebody help?
ASKER CERTIFIED SOLUTION
Mike Tomlinson
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros