Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code encounter compile error #20

Open
Jamespahan1995 opened this issue May 21, 2024 · 3 comments
Open

Code encounter compile error #20

Jamespahan1995 opened this issue May 21, 2024 · 3 comments

Comments

@Jamespahan1995
Copy link

Jamespahan1995 commented May 21, 2024

In the webdriveroption.cls code I am getting a compile error after importing the file in the vba environment due to the code of Version 1.0 class is coming in vba class module after importing. In webdrover.cls again got the compile error public sub open browser.

Let me know, if I am doing anything wrong here. I followed the steps mentioned on the got after downloading those files.

@er-ri
Copy link
Owner

er-ri commented May 22, 2024

Can you post your error message here?

@sridharstreaks
Copy link

sridharstreaks commented Feb 7, 2025

@Jamespahan1995 +1.
Im too getting the same error on MS office LTSC professional Plus 2021 while it is working fine in MS office LTSC professional Plus 2019. The error happens with MS excel and even the sample code is not working. @er-ri

Image
Image

Issue Description:
when tried to import all files webdriveroption.cls goes into modules with the following lines
"""Attribute VB_Name = "WebDriverOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False"""

automatically removed. Also this line 'VERSION 1.0 CLASS' marked as Red with error 'end of statement'.

Solutions tried:
I tried creating a class manually copying the code and pasting the in the newly created class but the same issue happens that

VERSION 1.0 CLASS
Attribute VB_Name = "WebDriverOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False

Have attached the images stating the issue. Upon searching the net some say these are for VB and not for VBA and hence expected. I'm a total beginner, so obviously, I didn't understand it. Is there anyway to mitigate this issue?

@er-ri
Copy link
Owner

er-ri commented Feb 8, 2025

@sridharstreaks
I don't have the MS office LTSC professional Plus 2021 so I can't reproduce the error. But the WebDriverOption.cls should be in Class Modules, just delete the following code block and rename the class name to 'WebDriverOption' in the second screenshot you posted. This may work.

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "WebDriverOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants