The parameter is incorrect system error message

sitewolf

Active Member
Joined
May 4, 2012
Messages
304
1574956150384.png


Lately, I think after an Office 365 update (but I've reinstalled since then and this is happening on my other puter, too) I've had issues....and not always the same ones, and in various spreadsheets (tho I think all are xlsm)
The above is what I'm now getting when trying to run a simple macro in one particular file, a file I had no previous issue with and a macro I've run many times for years.

Prior to that, I'd sometimes get errors in other spreads when trying to run macros (going into VB would show it stopped on something like a query refresh)
Prior to that, I'd even have issues (which still pops up on occasion) where I'd get a 'can't find project or library' error...and macros still in VB wouldn't even show up in the macro list..............which I just noticed is true with this current error as well.

It's driving me bananas.....and I don't even like bananas.

I don't know if this is the proper place for the question, but I didn't know where else. Given I'm not running into this with ALL macro-enabled files, and up to this point some I've had the issue with 'correct' themselves, and this is happening on more than one puter (but NOT on an old puter running an older Excel but still Windows 10) it has me frazzled. Maybe something on my main puter is causing some corruption and that's why I run into it on my other puter, I don't know. Can anyone point me to possible fixes?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Nobody has an answer....or place to point me to find one?! This is uber frustrating.
Today I open a file whose macros ran just fine Tuesday....and another simple macro that does nothing but copy from one sheet to another won't run...nor will the macro to run web queries even tho individually running them is fine.
 
Upvote 0
I believe that is a runtime error (right?), and we would need to see the VBA statement and any reference values in order to assist.

After you click OK, does VBA highlight the offending statement or part of the statement?

IIRC, it does not. Try the following in order to isolate the problem statement.

Add the following statement to the offending VBA procedure:

On Error GoTo oops

Ideally, that should be the first executable statement. But if you already use On Error in the procedure, you might need to be creative.

Add the following statements just before the procedure End statement:

oops:
Stop
Resume

Instead of the runtime error, you should not stop at the Stop statement. After pressing the f8 key twice, you should stop at the offending VBA statement.

Copy-and-paste the offending statement into a reply here, between "code" and "/code" tags embedded between square brackets.

Also, press ctrl+g to open the Immediate Window. Typing the question mark ("?") first each time, enter the name of each variable and Excel cell reference that you see in the statement.

Copy-and-paste the Immediate Window into your reply, again between "code" tags.

You might also copy-and-paste the entire VBA procedure into your replay, between "code" tags. The context might help us understand the error.
 
Upvote 0
1575128290123.png

I receive this one just running a macro that copies from one sheet to another before I refresh a web query on the first.
Clicking debug it's just the first line of the macro highlighted, a simple sheet selection- Sheets("DT").Select

Then I get the same when clicking the macro to refresh queries, and again it's the first line, a simple sheet selection, highlighted
Tho I did just notice that on a 3rd macro, one that opens a saved csv file the macro would replace the data in, it's the 3rd line of the macro that's highlighted, again a simple sheet selection.
The first line opens that csv file, the 2nd takes me back to the workbook, then the 3rd selects a sheet.
Again, these are macros I've had no reason to change in files I've used in some cases for years and only recently ran into these errors.

Adding your oops lines, the highlighted line is that added Stop line

Sorry, maybe I'm missing something, but all that happens clicking F8 is to turn my camera off/on.


That's on the spread giving me the runtime error above. For the file with the system error I originally posted, the macros don't even show at all and in VB the modules they're in don't open...even tho it's all fine on an older machine running Excel 2007 instead of 365. That has happened before with other files, then magically 'healed' itself later.

Maybe totally unrelated, because it happens sometimes on my work puter as well, but if I don't keep a blank workbook open other files can just shut down when I'm working in them, especially if I try to run a macro....and that's happening on my new Surface as well. The above problems happen on my new Surface, too...but none of these runtime/system errors happen on all xlsm files
 
Upvote 0
Sorry, maybe I'm missing something, but all that happens clicking F8 is to turn my camera off/on.

Sorry, but I don't believe I can help you. However, for future note....

Many laptops (including mine) have multiple uses for the f-keys. Sometimes you must press another control key at the same time in order for it function like the application f-key. On my laptop, by default, I must press Fn+f8, where "Fn" is a control key near the Ctrl key. However, again on my laptop, I can change the default by starting my computer in the BIOS.

When I do a google search for "surface laptop toggle f-key" without quotes, I see several possible explanations. See if any of those help you.

Sorry that I cannot help you with your VBA runtime error problems.
 
Upvote 0
FWIW if I put in your code and use Fn F8 it cycles from Stop to Resume to the same simple Sheet line it was stopping at....and goes only to that Sheet line if I don't have that oops code in.
I've tried removing some code, running the macro from the macro manager (normally I have form control buttons tied to these macros) and same thing....stops at the first Sheet activation line.

Like I said, the baffling part of this for me is the same spreads/macros work fine on an older machine running Excel 2007 yet has the same problems on my Surface with 365 (and purchased AFTER these issues started).....so whatever the issue is, that says it's either inherent to 365 or my laptop running 365 is causing issues that then get saved to these files...yet not causing a problem for 2007....

Some of these files include web queries, which I've begun (for other reasons) to switch to Google Sheets (is that a bad word here?) but not all of these issues involve macros that have a thing to do with a query.
 
Upvote 0
Many laptops (including mine) have multiple uses for the f-keys. Sometimes you must press another control key at the same time in order for it function like the application f-key. On my laptop, by default, I must press Fn+f8, where "Fn" is a control key near the Ctrl key. However, again on my laptop, I can change the default by starting my computer in the BIOS.
For those who have a Logitech keyboard, pressing the fn key and the Esc key may toggle the functionality of the function keys (it does on mine).
 
Upvote 0
Good to know, and I do sincerely appreciate that bit of information.

However, my original issues remain.
 
Upvote 0
Do you have any activex controls on your worksheets?
 
Upvote 0
I do use form controls to create buttons I attach macros to....some may be activex, yes.....bad?
 
Upvote 0

Forum statistics

Threads
1,215,101
Messages
6,123,094
Members
449,095
Latest member
gwguy

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