VB not closing application with .Quit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raddrummer
    New Member
    • Oct 2007
    • 26

    VB not closing application with .Quit

    Hi there,

    I have 2 issues happening that I could really use some help with. These are probably really easy....

    1) I'm using VB in Access to generate a Visio org chart and then save it to my machine. I'm running into syntax issues near the bottom of the page for the Target of the new org chart. I've tried:
    objAddOn2.Run "/QUIET=True /NAVBAR=False /SEARCH=true /TARGET="C:\Docu ments and Settings\SLozan o\My Documents\OrgCh art.htm"" but get an error.

    2) The Quit command isn't working. I get a popup box asking if "I'd like to save changes to Document 1?" Any ideas on this one??


    Here is the code I'm using. ANY help is appreciated.

    Sub Generate()
    Dim VisApp As Object
    Dim visDoc As Visio.Document
    Dim visExcelFile As String
    Dim objAddOn As Object
    Dim objAddOn2 As Object
    Dim orgWizArgs As String
    'Assign file location of Excel file that feeds into Visio
    visExcelFile = "C:\Documen ts and Settings\SLozan o\Desktop\Visio OCTest.xls"
    'START VISIO'S ORG CHART WIZARD
    Set VisApp = CreateObject("V isio.Applicatio n")
    Set objAddOn = VisApp.Addons.I temU("OrgCWiz")
    objAddOn.Run ("/S-INIT")

    'Add org chart arguments
    orgWizArgs = " /FILENAME=" & visExcelFile & " /NAME-FIELD=NAME /MANAGER-FIELD=SupID /DISPLAY-FIELDS=Name, Title /CUSTOM-PROPERTY-FIELDS=Title,Lo cation HIDDEN /SHOW-DIVIDER-LINE /SYNC-ACROSS-PAGES /HYPERLINK-ACROSS-PAGES"

    'fill in args here
    objAddOn.Run ("/S-ARGSTR " + orgWizArgs)

    'Run the wizard
    objAddOn.Run ("/S-RUN")

    'Save the document as a web page
    Set objAddOn2 = VisApp.Addons.I temU("SaveAsWeb ")

    'Add the Web Page Arguments/Preferences
    objAddOn2.Run "/QUIET=True /NAVBAR=False /SEARCH=true /TARGET=C:\Docum ents and Settings\SLozan o\My Documents\OrgCh art.htm"

    'Quit Visio and close everything out
    VisApp.Quit
    Set VisApp = Nothing

    End Sub
Working...