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

Importing Class incorrectly imports as Module and fails #24

Closed
timhall opened this issue Feb 19, 2014 · 7 comments
Closed

Importing Class incorrectly imports as Module and fails #24

timhall opened this issue Feb 19, 2014 · 7 comments
Labels

Comments

@timhall
Copy link
Member

timhall commented Feb 19, 2014

Originally reported with issue #22, seems that importing classes in Excel 2010/2013 64-bit is improperly treating them as modules and leaving behind header information that causes errors.

@timhall timhall mentioned this issue Feb 19, 2014
@timhall
Copy link
Member Author

timhall commented Feb 19, 2014

@dsrlb I was able to find a copy of Excel 2010 x64 and when I imported the files they were successfully added as Classes instead of Modules. Here was how I imported the files:

From VBA (Alt+F11):

  • File > Import File and select the file
  • Right-click the Microsoft Excel Objects tree and then import file

I'm closing this issue, but feel free to post an update if you're still getting the problem

@timhall timhall closed this as completed Feb 19, 2014
@przemoli
Copy link

przemoli commented Mar 7, 2014

Hi!

I still can not get Excel to import it correctly. (Excel 2013 SP1 64bit)

EDIT:
I have workaround:
Importing all the files.
Creating class modules.
Copying code from .cls files into those modules without headers.

After that VBA Project Compile returns no bugs.

@timhall
Copy link
Member Author

timhall commented Mar 7, 2014

@przemoli Would you be able to record a screencast of the steps that you are using to import the files and what is occurring? (http://www.screencast-o-matic.com/ seems helpful for recording screencasts) You can email me directly with the screencast (my email is in the source). This is an important issue to me and would like to have an official fix to avoid a workaround.

@timhall timhall reopened this Mar 7, 2014
@timhall
Copy link
Member Author

timhall commented Mar 16, 2014

To anyone following this, @przemoli sent me a screencast and there is indeed some strange import behavior happening that I'm trying to nail down now.

@timhall timhall added the bug label Jul 7, 2014
@timhall
Copy link
Member Author

timhall commented Jul 24, 2014

Ok, there have been a few more reported incidents of this and it does not appear to be limited to 64-bit Excel. The issue appears to be line endings. When extracted from the downloaded zip file, the line endings are UNIX-style (LF or \n) and from my local files they are Windows-style (CR + LF or \r\n). After switching the downloaded file with Windows-style line endings the file imported correctly as a Class. I'll look into how this can be resolved.

@timhall timhall changed the title Importing classes fails on Excel 64-bit Importing Class incorrectly imports as Module and fails Jul 24, 2014
@timhall
Copy link
Member Author

timhall commented Jul 24, 2014

Note: using install.bat imports classes correctly

@timhall
Copy link
Member Author

timhall commented Jul 24, 2014

I've updated the git config to use Windows-style line endings for modules and classes and from what I can tell it fixes the issue.

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

No branches or pull requests

2 participants