View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Help with function that crashes Excel

I would check the file on your machine and remove any references that are
non-standard (create a new workbook on your machine and with it active in
the VBE, go to tools=References - that should show you what is standard).
Do the same with your troublesome workbook as the activeworkbook (selected
in the Project explorer).

Remove any differences.
Then save the file

This is just a guess, however.

--
Regards,
Tom Ogilvy

"Ken Loomis" wrote in message
...
When I send my workbook to someone to run, it bombs and crashes Excel. No
warnings, No Message. No nothing.

I used this Function from Chip Peasron to determine if a file exits:

Function SheetExists(sname As String, _
Optional ByVal wb As Workbook) As Boolean

MarkSub "SheetExists"

' Chip Pearson
On Error Resume Next
If wb Is Nothing Then Set wb = ThisWorkbook
SheetExists = CBool(Len(wb.Sheets(sname).Name))
End Function
============

I call that function with this if statement:

If Not SheetExists("Oldfiles", ActiveWorkbook) Then

=============


I do not really understand the "File Exists" function, but it works fine

on
my system.

Using a GetInfo routine I got from somewhere, I have been able to capture
the following information about the system where this crashes, if it

helps:

Application Name 10.0
Operating system Windows (32-bit) 4.90
Application Path C:\PROGRAM FILES\OFFICEXP\OFFICE10
Library Path C:\PROGRAM FILES\OFFICEXP\OFFICE10\LIBRARY


On my system, where the program works, that GetInfo routine captures this:

Application Name 11.0
Operating system Windows (32-bit) NT 5.01
Application Path C:\Program Files\Microsoft Office\OFFICE11
Library Path C:\Program Files\Microsoft Office\OFFICE11\LIBRARY


Sorry for the bad formatting.



I hope I haven't provided too much information, but if you should need

more
please let me know.

Please help me figure this out.

TIA,
Ken Loomis