Jump to content

Legacy Tool Modification


BlackBox

Recommended Posts

You've heard the scenario before... Major migration to new servers, directory structure changes, and the original author is no longer working here. But the tool is valued, so i am attempting to revise it accordingly, and need some help.

 

I have gone through each module of the VBA project, and commented out each of the original hard-coded paths, and added a line for the correct path post-migration.

 

However, I still get this error which launches VBAIDE (Land Desktop 2009), and highlights the line of code shown automatically:

 

vba_error.PNG

 

We have upgraded our MS Office from 2003 to 2007 with this migration, but I cannot seem to find the call for any Excel library, etc.

 

I am adept at Visual LISP (ActiveX COM), but am a VBA novice; any help would be greatly appreciated!

Link to comment
Share on other sites

You may have to change a reference to the newer version of Excel.

 

VBAIDE-Tools-References...

 

Thanks for the prompt response.

 

Upon viewing the associated references, it appears (to me) that Office 12 (v2007?) is already being referenced, no?

 

office12.PNG

Edited by BlackBox
Typo
Link to comment
Share on other sites

After additional poking around, should the 'Microsoft Excel 12.0 Object Library' be targeting 'XL5EN32.OLB' in lieu of 'EXCEL.EXE'...?

Link to comment
Share on other sites

After additional poking around, should the 'Microsoft Excel 12.0 Object Library' be targeting 'XL5EN32.OLB' in lieu of 'EXCEL.EXE'...?

 

That is quite possible. Here is how it looks here with Excel 2003.

Ref.jpg

Link to comment
Share on other sites

Interestingly, my 'Microsoft Excel 5.0 Object Library' points to ..\OFFICE12\XL5EN32.OLB file.

 

When I attempt toredirect ...Excel 12.0... to the correct file, it gives an error:

 

vba_error2.PNG

 

The 5.0 Object Library is not selected, and the 2003 software is not installed.

Link to comment
Share on other sites

It sound like you're doing the right things. I don't know for certain, though, because I've never had to wrangle with that Migration/Upgrade. Probably fortunate for me.

 

For the sake of curiosity, was there an uninstall of 2003 prior to the upgrade to Office 2007?

Link to comment
Share on other sites

It's a bitter sweet to confirm that I doing the right things, as the functions still will not work.

 

For the sake of curiosity, was there an uninstall of 2003 prior to the upgrade to Office 2007?

 

No. IT physically replaced the HDD in each computer (for admin, managers, etc.), and the CAD users got all new computers. For example, I went from a Dell Precision 390 (PC), to a Dell Precision M4500 (Laptop) as part of my new role/responsibilities.

Link to comment
Share on other sites

I know at one time there was an issue with installing Office after an AutoCAD install. The Office setup procedure mucked up settings AutoCAD relied on for the VBAIDE. That particular issue could be fixed by reinstalling AutoCAD.

From what I recall, though, that sequence issue was resolved after a few AutoCAD releases.

Link to comment
Share on other sites

I really appreciate your time and effort to try and assist me, Seant.

 

It looks like I am at a stand-still until I have time to learn up on VBA, to better diagnose the issue I am experiencing.

 

Edit: Which is fine, as I see the code being ported to VB.NET, and .NET is something I'd like to learn next.

Edited by BlackBox
Link to comment
Share on other sites

You'll never guess how simple this was to solve.... I'm embarrassed :oops:, to say it.

 

Within the reference list, I deselected 'Microsoft Office 12.0 object library' then hit 'OK'.

 

Saved the project, then opened the references again. I scrolled down, and selected (not checked) 'Microsoft Office 12.0 object library' then hit 'Browse' and navigated to the ..\OFFICE12\XL5EN32.OLB file and hit 'OK'. Save the project... and walla!

 

Originally, there were two references to ... Office 5.0, and ... Office 12.0 that conflicted. Once the 12.0 was removed from the reference list, apparently that freed up to conflict.

 

Hooray! :D

Link to comment
Share on other sites

Good to hear that you’re back up and running.

This VBA solution may have been relatively easy but that shouldn’t cause embarrassment. Determining the level of mojo required is a handful in itself.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...