Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.templates
external usenet poster
 
Posts: 4
Default application displayalert not working?

hi

i got a VBA prog. to open excel. but, when the prog. open excel spreadsheet, there is an error. "Can't open pivot table soubrce file..." so, i tried to supress the error message via the code. but, VB stops at the Open() statement, and wait for me to respond to the message before it continues. and, i really want VB ignores the error, and continues

the oXL.DisplayAlerts = False does supress the error message IF i press F8 in VB editor to step through the code. but, if i set a breakpoint and hit F5 to jump over 5 lines of code. then, the error message comes up again

does anyone has any idea on that

thank you

will lam

Set oXL = New Excel.Applicatio

'wla
oXL.DisplayAlerts = Fals

TempFileString = sFileStrin
sTempTicker = Left(sFileString, Len(sFileString) - 4
On Error GoTo bai


TempFileString = sfilePath & "\" & TempFileStrin
Set owb = oXL.Workbooks.Open(FileName:=TempFileString, UpdateLinks:=False, ReadOnly:=False, ignoreReadOnlyRecommended:=True


Set oSht = owb.Worksheets.Item("Cover Page"

sAnalystEmail = Trim(oSht.Cells(9, 4).Value
If Not InStr(sAnalystEmail, "@") 0 The
PrepExcelFile = CStr(GetAnalystIDFromTicker(sTempTicker)
If PrepExcelFile = "" Then GoTo NoAnalys
Els
PrepExcelFile = GetAnalystIDFromDB(sAnalystEmail
If PrepExcelFile = "" Then GoTo NoAnalys
End I

For Each oWs In owb.Worksheet
oWs.Protect Password:="", DrawingObjects:=True, Contents:=True, Scenarios:=Tru
Nex

For Each oChart In owb.Chart
oChart.Protect Password:="", DrawingObjects:=True, Contents:=True, Scenarios:=Tru
Nex


- breakpoint he bProtected = ProtectedCheck(owb)


.. .

  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.templates
external usenet poster
 
Posts: 27,285
Default application displayalert not working?

What version of Excel. I believe this didn't work in xl97.

Also, where are you running this code. If it is in Excel, you don't need to
start a new instance of excel to open another workbook.

--
Regards,
Tom Ogilvy


"Will Lam" wrote in message
...
hi,

i got a VBA prog. to open excel. but, when the prog. open excel

spreadsheet, there is an error. "Can't open pivot table soubrce file..." so,
i tried to supress the error message via the code. but, VB stops at the
Open() statement, and wait for me to respond to the message before it
continues. and, i really want VB ignores the error, and continues.

the oXL.DisplayAlerts = False does supress the error message IF i press F8

in VB editor to step through the code. but, if i set a breakpoint and hit F5
to jump over 5 lines of code. then, the error message comes up again.

does anyone has any idea on that?

thank you,

will lam

Set oXL = New Excel.Application

'wlam
oXL.DisplayAlerts = False

TempFileString = sFileString
sTempTicker = Left(sFileString, Len(sFileString) - 4)
On Error GoTo bail


TempFileString = sfilePath & "\" & TempFileString
Set owb = oXL.Workbooks.Open(FileName:=TempFileString,

UpdateLinks:=False, ReadOnly:=False, ignoreReadOnlyRecommended:=True)


Set oSht = owb.Worksheets.Item("Cover Page")

sAnalystEmail = Trim(oSht.Cells(9, 4).Value)
If Not InStr(sAnalystEmail, "@") 0 Then
PrepExcelFile = CStr(GetAnalystIDFromTicker(sTempTicker))
If PrepExcelFile = "" Then GoTo NoAnalyst
Else
PrepExcelFile = GetAnalystIDFromDB(sAnalystEmail)
If PrepExcelFile = "" Then GoTo NoAnalyst
End If

For Each oWs In owb.Worksheets
oWs.Protect Password:="", DrawingObjects:=True, Contents:=True,

Scenarios:=True
Next

For Each oChart In owb.Charts
oChart.Protect Password:="", DrawingObjects:=True,

Contents:=True, Scenarios:=True
Next


- breakpoint he bProtected = ProtectedCheck(owb)


. .



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default application displayalert not working?

Hi Tom

i'm using excel 2002. i run it from VB6. thanks. -w

----- Tom Ogilvy wrote: ----

What version of Excel. I believe this didn't work in xl97

Also, where are you running this code. If it is in Excel, you don't need t
start a new instance of excel to open another workbook

--
Regards
Tom Ogilv


"Will Lam" wrote in messag
..
hi
i got a VBA prog. to open excel. but, when the prog. open exce

spreadsheet, there is an error. "Can't open pivot table soubrce file..." so
i tried to supress the error message via the code. but, VB stops at th
Open() statement, and wait for me to respond to the message before i
continues. and, i really want VB ignores the error, and continues
the oXL.DisplayAlerts = False does supress the error message IF i press F

in VB editor to step through the code. but, if i set a breakpoint and hit F
to jump over 5 lines of code. then, the error message comes up again
does anyone has any idea on that
thank you
will la
Set oXL = New Excel.Applicatio
'wla

oXL.DisplayAlerts = Fals
TempFileString = sFileStrin

sTempTicker = Left(sFileString, Len(sFileString) - 4
On Error GoTo bai
TempFileString = sfilePath & "\" & TempFileStrin

Set owb = oXL.Workbooks.Open(FileName:=TempFileString

UpdateLinks:=False, ReadOnly:=False, ignoreReadOnlyRecommended:=True
Set oSht = owb.Worksheets.Item("Cover Page"

sAnalystEmail = Trim(oSht.Cells(9, 4).Value

If Not InStr(sAnalystEmail, "@") 0 The
PrepExcelFile = CStr(GetAnalystIDFromTicker(sTempTicker)
If PrepExcelFile = "" Then GoTo NoAnalys
Els
PrepExcelFile = GetAnalystIDFromDB(sAnalystEmail
If PrepExcelFile = "" Then GoTo NoAnalys
End I
For Each oWs In owb.Worksheet

oWs.Protect Password:="", DrawingObjects:=True, Contents:=True

Scenarios:=Tru
Nex
For Each oChart In owb.Chart

oChart.Protect Password:="", DrawingObjects:=True

Contents:=True, Scenarios:=Tru
Nex
- breakpoint he bProtected = ProtectedCheck(owb
.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with XL and another not related application Excelfan Excel Discussion (Misc queries) 6 December 21st 08 02:45 AM
What do you do when DisplayAlert does not work in VBA? M. Hussaini Excel Discussion (Misc queries) 3 February 2nd 07 02:04 AM
application.displayalerts is not working will lam Excel Programming 2 April 30th 04 08:21 PM
Application.NetworkTemplatesPath Not Working Sonny Maou Excel Programming 7 February 25th 04 05:21 AM
Application::DisplayAlerts not working Howard Dierking Excel Programming 2 February 11th 04 12:04 PM


All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"