LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Calling? Invoke Public Function

When you're using Run, you don't include the path name of the file, only the
file name (e..g, "Book1.xls" not "C:\Test\Book1.xls"). Excel cannot have
two workbooks with the same file name open at the same time, so the Path is
irrelevant.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"David" wrote in message
...
Code:
Sub Chap7()
' Macro4 Macro
Dim FileName As String
z = 1
x = 0
Debug.Assert z < 0
Debug.Assert x < 0
On Error Resume Next
v = z / x
If Err.Number < 0 Then
Result = Application.Run("C:\Documents and
Settings\Owner\MyDocuments\Excel\VBA\Excel2003VBA! ErrorInformation", _
Err.Number, Err.Source, Err.Description, ActiveWorkbook.Name)
End If
(Trying to get above what is produced by below)
'If Err.Number < 0 Then
' Msg = "Error # " & Str(Err.Number) & " was generated by/ " _
' & Err.Source & Chr(13) & Err.Description & "/ " &
ActiveWorkbook.Name
' MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
'End If
End Sub

Tried to use a Call, but was not allowed, so I am trying to do a Run.
--
David



 
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
How to get userform Cancel button to invoke Exit Sub in calling macro? Craig Remillard New Users to Excel 1 November 19th 09 03:55 AM
Excel invoke REST service function with Xpath fn parse result! Rand0m1y Excel Worksheet Functions 0 June 4th 09 03:43 PM
Calling a Public Subroutine in a Different Workbook Raul Excel Programming 2 August 24th 05 04:27 AM
invoke a function mmc Excel Programming 3 July 27th 05 08:01 PM
Auto invoke of a VBA Sub function Jag Man Excel Programming 3 December 11th 03 09:26 AM


All times are GMT +1. The time now is 08:30 AM.

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"