473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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:\Documents and Settings\SLozano\My Documents\OrgChart.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:\Documents and Settings\SLozano\Desktop\VisioOCTest.xls"
'START VISIO'S ORG CHART WIZARD
Set VisApp = CreateObject("Visio.Application")
Set objAddOn = VisApp.Addons.ItemU("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,Location 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.ItemU("SaveAsWeb")

'Add the Web Page Arguments/Preferences
objAddOn2.Run "/QUIET=True /NAVBAR=False /SEARCH=true /TARGET=C:\Documents and Settings\SLozano\My Documents\OrgChart.htm"

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

End Sub
Mar 26 '09 #1
0 2451

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: simon place | last post by:
Spent some very frustrating hours recoding to find a way of closing a server socket, i'd not thought it would be any problem, however, after complete failure and as a last resort, i looked at the...
1
by: LynchburgRecord | last post by:
The Code Snippet (from VB Net in Visual Studio Net 2003) below does the following (1) Create a Front Page (2002) Application Objec (2) Open a We (3) Close the We (4) Execute Front Page...
2
by: andreas | last post by:
Hi, Who can gives me a explanation for this Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim xlApp As New Excel.Application()...
2
by: Atley | last post by:
I have written an application that exports data from SQL to Excel. It all works perfectly except that if you open the Task Manager after running my application, there is an instance of Excel in...
7
by: rdemyan via AccessMonster.com | last post by:
I want to make sure that I'm closing an opened spreadsheet correctly. I've been having some locking up problems. The following code adds a dummy row to the spreadsheet to ensure that that the data...
2
by: rdemyan via AccessMonster.com | last post by:
I have a custom message form that I want to display when the user shuts down my app. Some clean up needs to be done during shutdown and I want to display this form and then display various...
6
by: pleaseexplaintome_2 | last post by:
Help please. The excel instance is removed from task manager when I run the code below. If I uncomment the lines pertaining to a workbook, the instance of excel is not removed from task manager. ...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
2
by: Silgd1 | last post by:
Hi All.... I'm using python 2.4, Win XP Pro v.2002 sp3, and I use pyscripter 1.9.9.2 as my editor. I have written code to open an existing excel file and grab some data. The problem I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.