repost from v8 forum excel.application.ontimer "cannot run macro"

>I am using the "Application.ontimer" member of the excel library  to call a Public Sub GetTime()

>I am getting the error "Cannot run the Macro "GetTime" May not be available in this  workbook or all...."

>I've changed my security setting to "none" in Microstation XM, is there a place where I should look to see if macros are disabled?  I am running other vba, with no >problem.

The security setting that I changed is in the Microstation environment, under Workspace-Security

I add a clock to a vba form in Excel using the application.ontimer like:

  Public Sub  GetTime()

    Dim ID As Date

    UFClock.clock =Format(Now, "mm/dd/yy hh:mm:ss")

    ID = Now +TimeValue("00:00:0001")

    UFClock.LastTime= ID

    Application.OnTime ID, "GetTime"

End Sub

I wanted to do the same in microstation, but there isn't the Application.ontimer  so I loaded the excel library and used excel.application.ontimer but it won't launch the "gettime"  I've also tried "ufclock.gettime" .

I have the gettime in a module, but I've also tried it in the form programming as a private function.

any help is greatly appreciated.

 

Parents
  • It's still not clear which VBA you are using.  

    Does your GetTime() subroutine get called successfully if everything is written in Excel VBA?  

    In the snippet you posted, is GetTime() in Excel VBA or MicroStation VBA? 

    I don't think MicroStation security is relevant to your problem.  Microsoft applications these days turn macros off by default because of security issues, but that doesn't apply to MicroStation.

    MicroStation VBA does have a Timer function, by the way.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • It's still not clear which VBA you are using.  

    Does your GetTime() subroutine get called successfully if everything is written in Excel VBA?  

    In the snippet you posted, is GetTime() in Excel VBA or MicroStation VBA? 

    I don't think MicroStation security is relevant to your problem.  Microsoft applications these days turn macros off by default because of security issues, but that doesn't apply to MicroStation.

    MicroStation VBA does have a Timer function, by the way.

     
    Regards, Jon Summers
    LA Solutions

Children