LisHawj

_Excel_Open issue on Windows 10 & Office 2016

4 posts in this topic

#1 ·  Posted (edited)

I have an excel file stored on a SharePoint (networked) site that requires "checking" out the file to enable write.  I wrote a small script to open the target file, activate a sheet, and automatically populate cells from an array.  The script work fine if the target file is stored locally on the PC, but the script returns Error 2 that the file path does not exist if the file is on a network drive.  What is causing this?  The following conditions are true:

1. The network drive containing the target Excel file exists and target name is correct.
2. The Excel file on the network drive can be accessed and opened manually outside of the script.
3. Using __Excel_Open to open an Excel instance and browsing Open from the Excel instance shows no network drives mapped.  Only local drives are accessible and this is likely the root cause of the problem, but I don't understand why it can only see local drives.

I speculate that line item 3 above is the cause of my problem, but I don't understand why the Excel instance can only see local drives.  Thank you.

 

#include <GUIConstantsEx.au3>
#include <Array.au3>
#include <Excel.au3>
#include <File.au3>

Global $oExcel
Global $sWorkbook = "Y:\Pricing_catalog.xlsx"

;Let's open the Excel spreadsheet.
Global $oExcel = _Excel_Open()
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Update monthly spreadsheet", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
$oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook)
If @error = 1 Then
    MsgBox($MB_SYSTEMMODAL, "Update monthly spreadsheet", "Error - $oExcel is not an object or not an application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
    _Excel_Close($oExcel)
    Exit
ElseIf @error = 2 Then
        MsgBox($MB_SYSTEMMODAL, "Update monthly spreadsheet", "Error - The specified file path does not exist." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
    _Excel_Close($oExcel)
    Exit
ElseIf @error = 3 Then
        MsgBox($MB_SYSTEMMODAL, "Update monthly spreadsheet", "Error - Unable to open the file path." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
    _Excel_Close($oExcel)
    Exit
EndIf

 

 

 

 

 

 

 

 

Edited by LisHawj

Share this post


Link to post
Share on other sites



#2 ·  Posted

IIRC we already had a similar issue regarding Sharepoint some time ago. I'm on a business trip right now so I can't check. Will do so after my return. 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

Thanks you, Water.  I look forward to hearing and learning more about this issue regarding Sharepoint.

Share this post


Link to post
Share on other sites

#4 ·  Posted

The discussion about accessing SharePoint starts here:

Seems you need a different approach.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now