Hi I am new to this forum and was hoping someone may be able to help me with this problem.
I am using macros in my Excel 2007 files and recently got a new computer with Windows 7 64-bit Professional on it. I wanted to add more functionality to my workbook but there was some problem with the code.
When I hit 'Debug' it went to the code in VBA and 10 seconds later Windows was busy closing Excel - "Excel has stopped working". This happens every time no matter what I do!
I don't think this has to do with faulty Office products but the fact that Windows 7 sees Excel as non-responsive although I think it is only paused while I am stepping though the code!
Any ideas?
It's hard to say without seeing what you are doing
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Hi there sorry I got a bit distracted with work...
I am using this function (got it from somewhere) to resolve the network path which may be compromising the rest of the file (I don't have previous experience with this one):
and using it in a function later on in the macro:Declare Function WNetGetConnection32 Lib "MPR.DLL" Alias "WNetGetConnectionA" (ByVal lpszLocalName As String, ByVal lpszRemoteName As String, lSize As Long) As Long
My aim is to automatically put correct hyperlinks in the sheet to other excel files on our network (i.e. this file would be like a summary/directory from which to access the other files). I have another function which then retrieves some values from these other excel files but it seems to be crashing before then.Function GetNetPath(DriveLetter As String) cbRemoteName = lBUFFER_SIZE ' Specifies the size in characters of the buffer. lpszRemoteName = lpszRemoteName & Space(lBUFFER_SIZE) ' Prepare a string variable by padding spaces. lStatus& = WNetGetConnection32(DriveLetter, lpszRemoteName, cbRemoteName) ' Return the UNC path (\\Server\Share). ' Verify that the WNetGetConnection() succeeded. WNetGetConnection() ' returns 0 (NO_ERROR) if it successfully retrieves the UNC path. If lStatus& = 0 Then iChar = InStr(lpszRemoteName, Chr(0)) GetNetPath = Left(lpszRemoteName, iChar - 1) ' Display the UNC path. Else GetNetPath = "" ' Unable to obtain the UNC path. End If End Function
Last edited by zero212; 03-02-2011 at 07:43 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks