running the file conversion macro with prefilled values

How can I run the batch converter macro with prefilled values?

I need to do the same conversion job frequently and setting up the same batch conversion job is tedious.

I guess I should create a macro that calls the file converter macro with the given values, but I couldn't figure out how.

Thanks for the help.

SWK

Parents
  • Hi.
    Open the macro in the VBA editor. Open the form in design view. Click on the control (the form field) that you want to give a default value. In the properties window copy the Name of the control to the clipboard. Now go to form code view. Find the Private Sub UserForm_Initialize() routine. Under that last line in the sub paste the controls name you copied and give it a value.

    Example (see 'added':

    Private Sub UserForm_Initialize()
    Dim i As Integer
    InitUnitsCombo
    InitPageSizeCombo
    InitFileTypeCombo cboFileFormat
    InitBackGroundColor
    cmdBackgroundColor.BackColor = RGB(255, 255, 255)
    With frmFileConverter.cboVersion
    'Note we only use the current version (15) to version 14 since those are the only 2 that both draw and designer have in common
    For i = Application.VersionMajor To 14 Step -1
    .AddItem i
    Next
    .ListIndex = 0
    End With
    'added------------------------------------------
    chkSeparateFile = true
    txtSource = "C:/myfolder"

    End Sub
Reply Children
No Data