Jump to content

Help to open a file diferent user names


Go to solution Solved by dragan,

Recommended Posts

Posted (edited)

Hello guys,
I need a help with the follow command : 

#include <WindowsConstants.au3>
#include <Excel.au3>
#include <IE.au3>
Func _Main()
    Local $Input_CurrentUserName


    Global $sExcelFile = "C:\Users\ "& @UserName"\Desktop\teste.xls" ; <== Add the name of the Excel file here and your User
Global $oExcel = _ExcelBookOpen($sExcelFile)
Global $aExcelData = _ExcelReadSheetToArray($oExcel);$oExcel
$oIE = _IECreate()
_IENavigate($oIE, "site here"); 
EndFunc

 I have the need to open a file in the desktop  which  have a fixed name.

My problem is that each computer has a different code User. I would like this script to work on any computer.

Grateful to all.

Edited by vidaLL
Posted

Solved my friend.

thanks for your help.

Local $sFilePath1 = @DesktopDir & "\Pasta2.xls"
;Global $sExcelFile = @DesktopDir & "\Pasta2.xls" ; <== Add the name of the Excel file here and your User
Local $oExcel = _ExcelBookOpen($sFilePath1)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...