PDA

View Full Version : VBA error



levanduyet
10-07-2011, 10:12 PM
Dear All,
I have written one tool in Excel 2003 by VBA.

But when I use it in Excel 2010, the error show:

http://i2.photobucket.com/albums/y4/levanduyet/vba_err1.png

After clicking OK button, another error show:

http://i2.photobucket.com/albums/y4/levanduyet/vba_err2.png

So, I totally can not use this file.

Anyone know how to settle this problem?

Thanks,

LVD

GTO
10-07-2011, 10:21 PM
Care to show us the wb or offending code at least?

Bob Phillips
10-08-2011, 01:27 AM
Sounds like you have a DLL problem, an old version. Tracking it down might be tricky. What do you have in References in the VBIDE?

levanduyet
10-09-2011, 07:19 PM
Hi All,
The error was shown even I have disable all marco.
I have upload to Mediafire. Anyone help me.
http://www.mediafire.com/?zpikremi4xqyw3w

Thanks,

LVD
Ps: This file I have used for many years in Excel 2003.

GTO
10-10-2011, 01:24 AM
Hi LVD,

You can post the file here. Below the Quick Reply box, press the <Go Advanced> button. In the new window, scroll down to <Manage Attachments>.

Mark

GTO
10-10-2011, 01:25 AM
ACK!

PS - if it's over 1MB, zip it.

Bob Phillips
10-10-2011, 03:43 AM
That file is 82 Mb. I can't imagine anyone opening an 82Mb file.

GTO
10-10-2011, 04:55 AM
:omg: :ack:

levanduyet
10-10-2011, 07:15 AM
Hi xld, GTO,
As I have mention that this file I have used for long that's why it's big.
If I continue using it in Excel 2003 SP3, everything is okay. But when I use it in Excel 2010 (even disable all macro) the error always shown when I open it.

LVD

Aussiebear
10-10-2011, 07:33 AM
Sounds like you have a DLL problem, an old version. Tracking it down might be tricky. What do you have in References in the VBIDE?

As Bob has indicated,what references are used in the VBIDE? Its a sad but true fact that as Microsoft "improve" each version of Excel some things are left behind. In uploading a workbook try leaving out the data, so that we can see the VBA components,as this should reduce the workbook size.

levanduyet
10-10-2011, 09:06 PM
Sounds like you have a DLL problem, an old version. Tracking it down might be tricky. What do you have in References in the VBIDE?

Here is the ref.:

http://i2.photobucket.com/albums/y4/levanduyet/vba_ref.png

I think that because of some controls.
I have tried to export all modules: --> Okay
I have tried to export all forms: --> some forms can, some can not.

LVD

Norie
10-11-2011, 03:32 AM
Most of the solutions I've seen have involved registering DLLs.

The most common DLL seems to be MSCOMCT2.OCX which is MS Windows Common Controls 6.0, which has the MonthView, DatePicker etc.

You've got that reference selected but as has been suggested, perhaps you need to check the version.

Aflatoon
10-11-2011, 03:59 AM
Are you using 64bit Excel 2010? If so, the common controls are not compatible.

levanduyet
10-14-2011, 02:56 PM
Are you using 64bit Excel 2010? If so, the common controls are not compatible.
I use Excel 2010, 32bit.

LVD

levanduyet
10-14-2011, 03:03 PM
Most of the solutions I've seen have involved registering DLLs.

The most common DLL seems to be MSCOMCT2.OCX which is MS Windows Common Controls 6.0, which has the MonthView, DatePicker etc.

You've got that reference selected but as has been suggested, perhaps you need to check the version.
I have installed two version on the pc (Excel 2003 & Excel 2010).
I open in Excel 2003, it's ok. So, I don't think because of MSCOMCT2.OCX.

Tks.

LVD

Aflatoon
10-14-2011, 03:11 PM
Have you tried deleting all .exd files from your C drive with Excel closed, then opening in 2010? Also do you have another machine (Virtual or physical) that you may test it on with just Excel 2010 installed?

levanduyet
10-14-2011, 03:13 PM
Have you tried deleting all .exd files from your C drive with Excel closed, then opening in 2010? Also do you have another machine (Virtual or physical) that you may test it on with just Excel 2010 installed?
Hi Aflatoon,
Yes, I have another PC that just install Excel 2010.
But totally, I can not use this file (even disable all macro).

LVD

shrivallabha
10-17-2011, 08:45 AM
I thought I might connect these two dots. Probably you have similar requirements so might benefit from the same end-solution.
http://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/e84868ca-2662-41ae-a1ff-a1ea9cdc33b9

Norie
10-17-2011, 08:51 AM
shrivallabha

There doesn't seem to be a solution in that link.

Is it in one of the related questions?

shrivallabha
10-17-2011, 09:41 AM
Norie, You are right. It is just that two people are facing similar problems so I thought it will help both OPs as in the end they may end up with similar solution.

That said, I haven't have worked on Excel 2010 but I guess I read this somewhere (of course I could be wrong) that upto 2K7 versions it was VB6.0 and for 2K10 its VB7.0. Does it have any implications? Like Application.FileSearch which was good upto 2K3...

shrivallabha
10-21-2011, 11:17 AM
The thread I'd given link to is now solved. Levan can take a look there. Here's one of the post by user Calvin Gao


Hi Gerhard,
Thanks for your post.
For your issue that VBA code from Excel 2003 doesn't work in Excel 2010, you can consider using this tool to help you to check the code compatibility:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=15001 (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=15001)
I hope this helps.
Best Regards, Calvin Gao [MSFT]
MSDN Community Support | Feedback to us (msdnmg@microsoft.com)
Get or Request Code Sample from Microsoft (http://1code.codeplex.com)
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

biswarupgb
10-22-2011, 09:30 AM
Hello Everybody