Parameter passed incorrectly (empty)

DJAXE

New Member
Joined
Feb 15, 2011
Messages
29
Fairly strange event - hopefully I can explain it properly.

I have a fairly hefty Excel workbook with quite a bit of code in it - one particular event I keep seeing is that a parameter doesn't get passed correctly.

For example the line:
RowLockDown "ACCT", "equals", 6299

Calls the subroutine "RowLockDown" which is declared as follows:

Sub RowLockDown(ByVal sDim as string, byval sOp as string, byval vCode as variant)

However, occasionally (ie, not every time), when the RowLockDown routine executes the sDim (first) parameter is equal to a null string.

Indeed, if I try to populate sDim using the Immediate Window in runtime, it loses the value as soon as I advance the code.

Very peculiar.

I've been through a large number of processes trying to clean this code up such as
- running code cleaner (many times)
- ensuring no modules are too big
- removing all public variables
amongst others.

Anyone ever seen this before and have any suggestions?
 
Since you're on Excel 2003 it can't hurt to roundtrip the workbook through HTML, this sometimes gets rid of corruptions.
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
From Excel: Save-as to web page (html), close file, open (from within Excel) the html file, save-as to xls.
 
Upvote 0
Interesting.

Some additional news, I've managed to locate the VBA update that changes the version number to 6.5.1053. It's a security update in KB976382... I guess it's possible that there was something MS did when fixing the vulnerability that also fixed my problem, but I'm not sure how that would come about.
 
Upvote 0
Well, strange things do happen with some updates. They sometimes fix things earlier updates broke...
 
Upvote 0
Still... I'd love to know what aspect of my code was breaking it.

I've tried pulling pieces out but there's too much intermeshing of routines to do it without having to comment out massive chunks at a time.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top