|
-
Jun 28th, 2005, 12:18 AM
#1
Thread Starter
Fanatic Member
Excel Troubles - Mind Boggling
Alright, I have a slight problem.
Well actually it's more of a massive problem.
You see, I have code which fails on 'some' computers, but not 'other' computers. It also seems that it can go from not working to working, and vice versa. It seems that when a certain form is run (sometimes) excel crashes (no error message, just dies)
In any case, I went to where it wasn't working, and tried to narrow down where the problem was. I found out the problem is on this line:
if checkboxname.value = true then
Ignoring the fact that " = true" shouldn't be there, and that the checkbox obviously doesn't have that name, WHAT IS GOING ON?! I comment out the line and Excel goes down on a different line (I didn't spend the time to comment them all out)
I've run into this kind of thing before. Usually, exporting/importing the form or cutting/pasting the controls or even commenting/uncomment the code will make it 'go away'... but I can't seem to fix this one!
This software is going to Ontario within the week, and I want to have a patch ready to fix this problem (we've already released in Atlantic Canada)
Don't pay attention to this signature, it's contradictory.
-
Jun 28th, 2005, 12:30 AM
#2
Re: Excel Troubles - Mind Boggling
What version(s)? The True is optional and is ok if its there. Could it be that if you cut and paste the contol your may be
using a different versons of the control on different versions of Excel?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 29th, 2005, 08:57 AM
#3
Thread Starter
Fanatic Member
Re: Excel Troubles - Mind Boggling
 Originally Posted by RobDog888
What version(s)? The True is optional and is ok if its there. Could it be that if you cut and paste the contol your may be
using a different versons of the control on different versions of Excel?
We test on 97 and 2003. I don't know if the problem only exists in 97 or not, but I do know that people using the same file can have the problem or not have the problem. (The file is NOT saved or modified during execution)
Don't pay attention to this signature, it's contradictory.
-
Jun 29th, 2005, 09:15 AM
#4
Re: Excel Troubles - Mind Boggling
Might be a memory problem. API calls can crash it for no reason, and if the variables aren't cleaned up right, it can cause a crash too.
Otherwise, try exporting all modules as text files, and any forms too. Create a new spreadsheet and reimport all those text files.
Also you may want to check as you import as whether it is dying (if you can) as it may only one particular module/code that is causing the problem (corruption perhaps?)
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 29th, 2005, 11:11 AM
#5
Re: Excel Troubles - Mind Boggling
Correct Vince. Which APIs are your using Alkatran? CopyMemory is usually an API that will crash your program if not used properly.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 3rd, 2005, 09:37 AM
#6
Thread Starter
Fanatic Member
Re: Excel Troubles - Mind Boggling
There are no API calls being used on the form. I believe that the only API call used in the program is GetVolumeInformation, which we use to get the drive's serial number (which we use as a seed for activation keys so people can't easily 'copy' the software from a friend)
It is conceivable that this would be called BEFORE the form starts, but that wouldn't explain why only this form seems to be affected. (the API is called almost anytime they leave the main screen or start the program)
Here is our code for the serial number:
VB Code:
Public Function getSerialNumber() As Long
'Gets the storage medium's serial number
Dim SerialNumber As Long
Dim VName As String
Dim FSName As String
On Error GoTo Method2
VName = String(255, Chr$(0))
FSName = String$(255, Chr$(0))
GetVolumeInformation Left(ThisWorkbook.Path, 3), VName, 255, SerialNumber, 0, 0, FSName, 255
getSerialNumber = Abs(SerialNumber)
Exit Function
'error 429
Method2:
Dim FileSystemObject As Variant
Dim D As Variant
'fso method requires wshom.ocx activeX component to work - missing on some win98 systems
Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
Set D = FileSystemObject.GetDrive(Left(ThisWorkbook.Path, 2))
SerialNumber = Abs(D.SerialNumber)
getSerialNumber = Abs(SerialNumber)
End Function
Don't pay attention to this signature, it's contradictory.
-
Jul 3rd, 2005, 09:23 PM
#7
Re: Excel Troubles - Mind Boggling
I have a similar problem. It turned out to be the use of Left.
If I rem that line out the app runs fine!
It would appear that some pc platforms that dont have the latest librarys have this problem.
Bruce.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|