Coder Social home page Coder Social logo

UNC path issue about importexcel HOT 9 CLOSED

dfinke avatar dfinke commented on May 27, 2024
UNC path issue

from importexcel.

Comments (9)

meterien avatar meterien commented on May 27, 2024 1

I try to use the function Get-ExcelSheetInfo which work great with path. I have a specific UNC path with a space in it and it give an error (maybe it the same error):

New-Object : Exception lors de l'appel de « .ctor » avec « 4 » argument(s) : « Le format du chemin d'accès donné n'est pas pris en charge. »
Au caractère D:\GitMETERIEN\MDTKonsole\Modules\ImportExcel\Get-ExcelSheetInfo.ps1:33 : 19

  • ... $stream = New-Object -TypeName System.IO.FileStream -ArgumentList $ ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation : (:) [New-Object], MethodInvocationException
    • FullyQualifiedErrorId :
      +1: ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Thanks!

from importexcel.

Houndin avatar Houndin commented on May 27, 2024 1

I'm also experiencing trouble with Import-Excel I've switched it to (Resolve-Path $path).ProviderPath but.... I have spaces in my UNC filename and am getting the same error as @meterien though, in English:
New-Object : Exception calling ".ctor" with "4" argument(s): "The given path's format is not supported."

from importexcel.

dfinke avatar dfinke commented on May 27, 2024

Thanks, I'll investigate

from importexcel.

urlocalguru avatar urlocalguru commented on May 27, 2024

I assume this is implied but as a side note just doing
import-excel -path "\networkshare\foo.xlsx" -sheet fools
also fails

from importexcel.

dfinke avatar dfinke commented on May 27, 2024

Looks like New-Object -TypeName System.IO.FileStream in Import-Excel is an issue and may be similar for the Export-Excel thanks to @philiplavoie for the repro.

Hopefully will get to this soon.

Is it blocking you?

from importexcel.

mrutgers avatar mrutgers commented on May 27, 2024

No, it is not blocking me because as far as I can tell using the ProviderPath property in all calls to Resolve-Path (in Export-ExcelSheet.ps1 and ImportExcel.psm1) will avoid the issue.
I am still (slowly) making progress in working out what is needed to make the package work with PowerShell v2, because we are using mainly Server 2008R2 / Windows 7 where I work. Being able to generate XLSX files instead of plain CSV has the potential to simplify / enhance some of our processes.

from importexcel.

DarkLite1 avatar DarkLite1 commented on May 27, 2024

Is this not resolved now with the latest commit?

from importexcel.

Houndin avatar Houndin commented on May 27, 2024

@DarkLite1 I don't know. I ended up not using Import-Excel as I had a deadline to meet.

from importexcel.

dfinke avatar dfinke commented on May 27, 2024

Yes, I checked that in for Import-Excel and published it

from importexcel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.