excel - Clicking a button on a userform (calling the a button click event) -


i'm trying automate macro converts excel table latex source code simple macro. don't want use userform, i'm trying call button click of desired output want, i'm having problems.

it excel2latex macro on ctan.org

userform here

project layout here

here main sub, can see commented parts different things i've been trying after searching help.

sub latex() newcontroller     set .view = newview     set .model = newdefaultmodel     set .storage = newstorage     .run     application.wait + timevalue("00:00:02")    frmconvert.cmdsave.object.value = true     'userform2.commandbutton1.object.value = true       'frmconvert!cmdsave.setfocus      'sendkeys "{enter}"      'call frmconvert.cmdcopy_click     'call frmconvert.cmdsv     'call frmconvert.cmdcopy_click     'call memento.saveconversionresulttofile     'application.wait + timevalue("00:00:03")     'application.run "frmconvert.cmdcopy_click", txtresult     'frmconvert.cmdcopy = true     'frmconvert.cmdcopy = vbclick     'frm 'application.run frmconvert.cmdsave     'call frmconvert.cmdcopy_click     'frmconvert.cmdsave = vbclick  end    end sub 

the code behind button want private sub

private sub cmdsave_click()   saveconversionresulttofile mmodel   hide end sub 

when try call cmdsave_click sub returns run time error 91, object variable or block variable not set. i've tried setting sub public too.

the luck i've had far activating copy clipboard button on userform, copies default text in userform, not latex table generated in window.

any suggestions?

public sub saveconversionresulttofile(byval pmodel imodel)  dim sfilename string  sfilename = pmodel.absolutefilename  if sfilename = "" exit sub   open sfilename output 1  print #1, pmodel.getconversionresult;  close #1 end sub 

i error on sfilename = pmodel.absolutefilename line in reference matthewd's question.

just call controls event.

sub latex()     newcontroller         set .view = newview         set .model = newdefaultmodel         set .storage = newstorage         .run         application.wait + timevalue("00:00:02")          cmdcopy_click         cmdsave_click      end end sub 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -