[SOLVED] Visual Basic for Applications or Visual Studio, what is the difference?

tomseurocat

Distinguished
Mar 26, 2014
197
3
18,695
I'm having no success with Microsoft on this issue. I have Office 2016 Pro on my PC. I run macros on a weekly basis using it. I downloaded a spreadsheet from a very reputable source and he said that he used Office 365 to write the code for the macros, I tried to run his macros and I get a compile error: Can't find project or library. I've tried to update the Visual Basic for Applications only to find out that VBA isn't even on my PC. I have checked the VBA permissions text in the Trust Center and in going to the directory that I was told that VBA would be in, there's no VBA folder, like VBA isn't even on my PC. Updating the version of VBA is impossible because the update isn't reading that VBA is on the PC to update.
My question is two-fold. 1) I downloaded Visual Studio thinking that it would contain the necessary files to activate VBA on my PC. That didn't happen! So I need to understand the difference between VS and VBA? 2) Where can I get the regular VBA program? From everything that I've researched it should be included in my download of Office 2016 Pro. I've run the repair/modify option in Apps & Features and still no VBA on my PC.
Help Please!
 

USAFRet

Titan
Moderator
VBA is a language. Used within the Office suite. There is no "program"....Office itself has VBA functionality within it.

Visual Studio is a tool, used to write code for VBA and other languages.

Office365 and Office 2016 are different (a little).
If the thing you obtained was for O365, your Office 2016 suite may not have the underlying libraries to run that macro.
 
D

Deleted member 14196

Guest
Yes you’re going to need office to 365 to run it most likely because you’re missing the library that it’s depending on
 
  • Like
Reactions: tomseurocat
D

Deleted member 14196

Guest
Can you post the exact error that you get?
 

tomseurocat

Distinguished
Mar 26, 2014
197
3
18,695
8Ng6iG8.png


rPiN5Dk.png


Uet9KxF.png
 

USAFRet

Titan
Moderator
OK...that is a reasonably complex thing.

Where is "fullpath" defined? The code is looking for it, and does not see it.

You downloaded this from someone...does it work in his environment?
 

tomseurocat

Distinguished
Mar 26, 2014
197
3
18,695
Yes, he said that he wrote this in and uses Office 365 to run this macro. He said that more likely than not it is a legacy issue and feels that I would have to get Office 365 to solve the issue. Is there a specific question that I should be asking him?
 
Last edited:

tomseurocat

Distinguished
Mar 26, 2014
197
3
18,695
I found out that I'm missing Shockwave Flash and is the reason for the compile issue. How can I overcome that Shockwave Flash's end of life has come and gone now?
 

tomseurocat

Distinguished
Mar 26, 2014
197
3
18,695
I guess that would take the creator of the Macro to rewrite it. I'm simply a user of the spreadsheet and don't know enough about it to rewrite the code. I've only recorded very simple 10 step of less Macros for my own use.
 

tomseurocat

Distinguished
Mar 26, 2014
197
3
18,695
Mandark had made a post and seems to be deleted now, saying that if I posted the code y'all may be able to tell me how to rewrite it so that Shockwave Flash is bypassed. The creator of the Macro is in the wind. Is that something that someone would be willing to help with?
 
Looking at the displayed code, I don't see why Flash would be an issue here. All that code is doing is opening a file dialog that lists any .csv (Excel) files, and saves the path to said file in the fullpath variable. [Note: VBA is a fully interpreted language; you don't have to previously declare fullpath anywhere in code like you do in compiled languages]. Code seems valid from what I can see at a glance, which means there's probably some other user-specific issue at play here.

What's likely going on here is either the re-write of the code has caused a dependency on Office 365, or has caused a new dependency on some library/feature that you do not have installed.
 

tomseurocat

Distinguished
Mar 26, 2014
197
3
18,695
Looking at the displayed code, I don't see why Flash would be an issue here. All that code is doing is opening a file dialog that lists any .csv (Excel) files, and saves the path to said file in the fullpath variable. [Note: VBA is a fully interpreted language; you don't have to previously declare fullpath anywhere in code like you do in compiled languages]. Code seems valid from what I can see at a glance, which means there's probably some other user-specific issue at play here.

What's likely going on here is either the re-write of the code has caused a dependency on Office 365, or has caused a new dependency on some library/feature that you do not have installed.

I have found out, via the Microsoft community, that I had to reset VBA then deactivate shockwave player in the library reference and all works now. I appreciate all the help!