Saving Different in Visio 2003 than 2002?

D

DTran

Hi,

I'm trying to run a macro that worked perfectly in Visio 2002, but when I
run it in Visio 2003, it gives me this error:

"Run-time error '-2032465768 (86db0898)':

An exception occured."

That, or where it says "... An exception occured.", it will say "Cancel."
When I hit the "Debug" button, it's always highlighted to the line with
"variable.Save". So is saving in Visio 2003 different than saving in 2002?
Any insight?
 
P

Paul Herber

Hi,

I'm trying to run a macro that worked perfectly in Visio 2002, but when I
run it in Visio 2003, it gives me this error:

"Run-time error '-2032465768 (86db0898)':

An exception occured."

That, or where it says "... An exception occured.", it will say "Cancel."
When I hit the "Debug" button, it's always highlighted to the line with
"variable.Save". So is saving in Visio 2003 different than saving in 2002?
Any insight?

in Visio 2003 save the file manually, ensure you save in Visio 2003
format, then try your macro. What might be happening is that the file
is in Visio 2000/2002 format and Visio is trying to ask you whether
you want to update the save format.
 
D

DTran

Yes, that was exactly the problem. I just figured it out myself, but thank
you very much for the prompt reply.
 
J

Jatin Sitapara

Hi,

I have developed a VB6 programme which is able to change the Fill Pattern of the shapes in a Visio Files.
But the problem is:
- I have to use Visio 2003.
- The files are ceated using Visio 2002.
- While running the code, it throws the error when I am using Application.AlretResponse to default save Current Version.
- It throws the error. "Cancel".
- I have to update thousands of Visio 2002 files, whose Fill Patterns needs to be updated. So don't want to save to files to Visio 2003 manually.
- I'll have to any how update/save these files to Visio 2003, programmatically.
- Any code in VBA or VB6 or VB.NET will help me a lot to proceed.

Please have a look into code below:

Sub ChangeFillPattern()

' Set numbers for each shape on all the pages of all the documents within a directory
' The changes are done in a temporary directory in case a problem arises.

Dim docObj As Visio.Document
Dim shpsObj As Visio.Shapes, shpObj As Visio.Shape
Dim i1 As Integer
Dim PathFileName As String, PathName As String, CurrFileName As String
Dim curPageIndx As Integer, curShapeIndx As Integer ' Loop variable
Dim ShapesCnt As Integer, ShapeLevel(200) As String

'On Error GoTo ErrHndlr:
'On Error Resume Next
' Set the default pathname
PathName = "C:\VisioTemp\"
PathFileName = PathName & "*.vsd"

' Find the first file from the directory (not necessarily the first alphabetically)
CurrFileName = Dir(PathFileName)

Do While CurrFileName <> ""

' Open the file
PathFileName = PathName & CurrFileName
Set docObj = Documents.Open(PathFileName)
Set pagsObj = docObj.Pages

docObj.Application.AlertResponse = 6
docObj.Save
docObj.Close

CurrFileName = Dir
Loop

'ErrHndlr:
'MsgBox Err.Description
End Sub
 
P

Paul Herber

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top