Jump to content
Sign in to follow this  
vidaLL

Help to open a file diferent user names

Recommended Posts

vidaLL

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

Share this post


Link to post
Share on other sites
vidaLL

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)

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
Sign in to follow this  

×