473,480 Members | 4,939 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Microsoft Office 2003 Pro - Strange Error at runtime

This error is driving me nuts. The code below will run perfectly when
it has a breakpoint. But as soon as I remove the breakpoint and run it
normally outside of debug mode I get a strange error message that says:

"Microsoft Office PowerPoint has encountered a problem and needs to
close. We are sorry for the inconvience.

If you were in the middle of something, the information you were
working on might be lost."

If any one can help with this I really would appreciate. Here is the
code:
Function CreatePowerPointCatiaImage(vbFilePath As String)
Dim ppApp As PowerPoint.Application
Dim mySlide As PowerPoint.Slide
Dim mytShape As PowerPoint.Shape
Dim shpCurrShape As PowerPoint.Shape
Dim myDocWin As PowerPoint.DocumentWindow
Dim myPicture As String
Dim path As String
Dim vbFilePath2 As String
Dim prsPres As PowerPoint.Presentation
Dim IStartedppApp As Boolean

vbFilePath2 = "c:\winnt\temp\CatiaImage.ppt"

' Noice the extra slashes
If ppApp Is Nothing Then
Set ppApp = New PowerPoint.Application
IStartedppApp = True
End If

'ppApp.Activate 'this flashes powerpoint onscreen can't hide it per
vberror
With ppApp
Set prsPres = .Presentations.Add(msoTrue)
With prsPres
Set mySlide = .Slides.Add(.Slides.Count + 1, ppLayoutBlank)
With mySlide
mySlide.Shapes.AddPicture vbFilePath, msoFalse, msoTrue,
50, 30, 600, 480
End With
' With ppApp 'must use Activate as shown above
' ppApp.ActiveWindow.ViewType = ppViewSlide
' End With
If FileExists(vbFilePath2) Then
Kill (vbFilePath2)
End If
prsPres.SaveCopyAs vbFilePath2

'ppApp.Quit 'Quit PowerPoint - if you have a command after it will not

End With
End With

If IStartedppApp Then ppApp.Quit
Set ppApp = Nothing
Set mySlide = Nothing
Set mytShape = Nothing
Set shpCurrShape = Nothing
Set myDocWin = Nothing


End Function

Nov 13 '05 #1
1 2335
Don't see an obvious error. Make sure you actually run 'Compile' from the
menu rather than just closing.

Darryl Kerkeslager
<so**********@netzero.net> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
This error is driving me nuts. The code below will run perfectly when
it has a breakpoint. But as soon as I remove the breakpoint and run it
normally outside of debug mode I get a strange error message that says:

"Microsoft Office PowerPoint has encountered a problem and needs to
close. We are sorry for the inconvience.

If you were in the middle of something, the information you were
working on might be lost."

If any one can help with this I really would appreciate. Here is the
code:
Function CreatePowerPointCatiaImage(vbFilePath As String)
Dim ppApp As PowerPoint.Application
Dim mySlide As PowerPoint.Slide
Dim mytShape As PowerPoint.Shape
Dim shpCurrShape As PowerPoint.Shape
Dim myDocWin As PowerPoint.DocumentWindow
Dim myPicture As String
Dim path As String
Dim vbFilePath2 As String
Dim prsPres As PowerPoint.Presentation
Dim IStartedppApp As Boolean

vbFilePath2 = "c:\winnt\temp\CatiaImage.ppt"

' Noice the extra slashes
If ppApp Is Nothing Then
Set ppApp = New PowerPoint.Application
IStartedppApp = True
End If

'ppApp.Activate 'this flashes powerpoint onscreen can't hide it per
vberror
With ppApp
Set prsPres = .Presentations.Add(msoTrue)
With prsPres
Set mySlide = .Slides.Add(.Slides.Count + 1, ppLayoutBlank)
With mySlide
mySlide.Shapes.AddPicture vbFilePath, msoFalse, msoTrue,
50, 30, 600, 480
End With
' With ppApp 'must use Activate as shown above
' ppApp.ActiveWindow.ViewType = ppViewSlide
' End With
If FileExists(vbFilePath2) Then
Kill (vbFilePath2)
End If
prsPres.SaveCopyAs vbFilePath2

'ppApp.Quit 'Quit PowerPoint - if you have a command after it will not

End With
End With

If IStartedppApp Then ppApp.Quit
Set ppApp = Nothing
Set mySlide = Nothing
Set mytShape = Nothing
Set shpCurrShape = Nothing
Set myDocWin = Nothing


End Function

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1464
by: Alexandre Jaquet | last post by:
Hi does anybody know how to solve my trouble, when I try to create a MS Office project I always got trouble. I can't create office project when I try to create one vs.net restart ... :s
1
1556
by: Nile | last post by:
helo, I needed to create office projects from Visual Studio and installed Office Pro 2003. Visual Studio 2003 in already running. But after Office installation is completed, I wasn't able to see...
1
6257
by: GrantS | last post by:
I am needing to launch Microsoft Office 2003 Picture manager and display a selected image - from my Winforms C# application. The path to the files will be c:\Documents and Settings\USERNAME\My...
1
1607
by: AmiciDan | last post by:
When I attempt to create a new project in Visual Studio .NET 2003, I do NOT have the option to create the following: Microsoft Office 2003 Projects What do I need to install or do to get this...
6
1959
by: ©pEIO | last post by:
I have installed the PIA of Microsoft Office 2003 and the installation was succefully. If I add the reference of Microsoft Excel 11.0, I see that the property CopyLocal is False and the assembly...
0
1063
by: LiHo | last post by:
Hi, I am writing a service which replies the response from Send Fax service which is a new feature in Office 2003. I have tested with a call from my test applcation and it works but when I tested...
1
1696
by: =?Utf-8?B?a2FybHJlbnR6aGVpbWVy?= | last post by:
When attempting to install Microsoft Office 2003 Professional Edition onto Windows Vista, an error message occurs stating that elevation is required to install. It is on an Acer laptop if that...
0
1423
by: Wolfgang Kaiser | last post by:
Hi NG, I have to face severe problems when I open a Access 2000 Database with the Access 2000 Runtime on a computer where Office 2003 is installed. I could not find any bug within my database. ...
0
926
by: carbanancizpo | last post by:
microsoft office 2003 product key crack http://cracks.12w.net F R E E
0
7040
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
6905
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
6908
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...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.