
qwiqshot
Active Members-
Posts
75 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by qwiqshot
-
Google Chrome, Maps, Satellite view by default
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
ugh, disregard, so simple. found a much simpler solution. Create a bookmark to open this address every time. https://www.google.com/maps/@37.6,-95.665,5737602m/data=!3m1!1e3 -
Does anyone know if there is a setting anywhere in Chrome browser and/or Google Maps page to automatically display the Satellite view by default so that I do not require writing a script to do so? please see the attached picture of what I am referring to. I have a function that grabs an address from a spreadsheet and enters it into Google Maps and I then switch the view from Street Map to Satellite to grab a screenshot. I'm just trying to figure out what can be automated and what cannot. I know there are hidden settings such as the ones listed here.
-
Pop this in before the function, adjust the sleep time to whatever exceeds your needs. Example, you know the cycle duration to log in and bump the counter is 3 minutes. adjust the timer to three minute value While 1 Sleep (50) WEnd Per help details.... Amount of time to pause (in milliseconds).
-
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Here is some amended code for saving aPowerPDF file the same name into the same directory as the saved Excel file, after it was saved from using _Excel_BookAttach Func SavePDF() Sleep (750) send ("{ESC}") Local $oExcel = _Excel_Open() ; Connect to already running Excel instance $cName = ($oExcel.Worksheets(4).Range("J20").Value) ; Customers name $cAddress = ($oExcel.Worksheets(4).Range("I30").Value) ; customers address $string = $cName & " " & "(" & $oExcel.ActiveSheet.Name & ")" & " " & $cAddress $networkFolder = "\\MYCLOUDEX2ULTRA\Bids\2016 Bids\Marks Bids\" & $cName & " " & "(" & $oExcel.ActiveSheet.Name & ")" & " " & $cAddress If Not IsObj($oExcel) Then Exit MsgBox(0, "Error", "_Excel_Open()") EndIf If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "You have no excel file open or you have already saved and renamed the file" & @CRLF & "@error = " & @error & ", @extended = " & @extended) ControlSend ("AsphaltEstimating - Nuance Power PDF Standard", "", "", "^+{S}") Sleep (500) Send ($networkFolder & "\" & $string) Sleep (500) ControlSend ("AsphaltEstimating - Nuance Power PDF Standard", "", "", "^+{ENTER}") Sleep (500) EndFunc -
Attach to Existing Excel file
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Modified email function for reference too, for use with GMail layout, regardless of newly created or existing file names.... Func WriteEmail() Sleep (750) Local $oExcel = _Excel_Open() ; Connect to already running Excel instance If Not IsObj($oExcel) Then Exit MsgBox(0, "Error", "_Excel_Open()") EndIf If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error writing email", "Something went wrong, cannot continue!" & @CRLF & "@error = " & @error & ", @extended = " & @extended) send ($oExcel.Worksheets(4).Range("E3").Value) ; email address Sleep (500) Send ("{TAB}") Sleep (125) Send ("{TAB}") send ($oExcel.Worksheets(4).Range("E4").Value) ; customer address Send ("{TAB}") Sleep (125) Send ("Hello ") Sleep (125) send ($oExcel.Worksheets(4).Range("A6").Value) ; customers name Sleep (75) Send ("{ENTER}") Send ("{ENTER}") Sleep (75) send ("Attached you will find our proposal for ") Sleep (125) send ($oExcel.Worksheets(4).Range("E4").Value); customer address Send ("{ENTER}") sleep (75) $File = "C:\Excel\z-eMail3.txt" $Open = FileOpen($File, 0) $Read = FileRead($Open) sleep (75) ClipPut($Read) sleep (75) FileClose($Open) Sleep (150) Send ("^v") EndFunc -
Attach to Existing Excel file
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Easy change. This does the trick. Func test() Local $oExcel = _Excel_Open() ; Connect to already running Excel instance If Not IsObj($oExcel) Then Exit MsgBox(0, "Error", "_Excel_Open()") EndIf If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "You have no excel file open or you have already saved and renamed the file" & @CRLF & "@error = " & @error & ", @extended = " & @extended) Send ($oExcel.Worksheets(4).Range("I30").Value) Sleep (250) Send ("{ENTER}") Sleep (500) EndFunc Took the inspiration from one of my many printing functions.... Func LegalCopies() Local $oExcel = _Excel_Open() ; Connect to already running Excel instance If Not IsObj($oExcel) Then Exit MsgBox(0, "Error", "_Excel_Open()") EndIf _Excel_Print($oExcel, "A1:M55", 2, "Xerox WorkCentre 7556 PS Contract Paper") ; print 2 copies of contract on contract paper for mailing Sleep (500) EndFunc Now works regardless if it's a newly created (not saved yet) excel file or one that has been saved and renamed etc etc. Thanks again -
Attach to Existing Excel file
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
I found another need to figure this out. After I have saved my excel file I also save my PDF file I have created along side the excel file, as the exact same name, into the exact same folder, but it will also require accessing the file *after* being saved. This is what I have now, to name the PDF and it too works, but only saves the file to the root of where the folder would be created (\\MYCLOUDEX2ULTRA\Bids\2016 Bids\Marks Bids\) and not in the case folder like the one that Func SaveAsphalt() creates. Func SavePDF() Sleep (750) send ("{ESC}") Local $sWorkbook = "c:\Excel\AsphaltEstimating.xlsm" ; Connect to AsphaltEstimating sheet Local $oExcel = _Excel_Open() $oWorkbook = _Excel_BookAttach($sWorkbook) ; Attach to Workbook $sDir = "\\MYCLOUDEX2ULTRA\Bids\2016 Bids\Marks Bids\" $fName = ($oWorkbook.Worksheets(4).Range("J20").Value) ; Customers name $cAddress = ($oWorkbook.Worksheets(4).Range("I30").Value) ; customers address $sFilePath = $sDir & $fName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "Something went wrong, start the script over and try again" & @CRLF & "@error = " & @error & ", @extended = " & @extended) ControlSend ("AsphaltEstimating - Nuance Power PDF Standard", "", "", "^+{S}") Sleep (500) ControlSend ("AsphaltEstimating - Nuance Power PDF Standard", "", "", $sFilePath) Sleep (500) ControlSend ("AsphaltEstimating - Nuance Power PDF Standard", "", "", "^+{ENTER}") Sleep (500) EndFunc -
Hi I have this script as part of my hotkey compilation (see below), that auto enters the customers address into what ever field I have selected, be it Google Earth or Google Maps etc, it works flawlessly, but I would like to amend the code to be useful regardless of the name of the excel file. Func WhereTo() Local $sWorkbook = "c:\Excel\AsphaltEstimating.xlsm" ; Create application object and open an example workbook Local $oExcel = _Excel_Open() $oWorkbook = _Excel_BookAttach($sWorkbook) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "You have no excel file open or you have already saved and renamed the file" & @CRLF & "@error = " & @error & ", @extended = " & @extended) Send ($oWorkbook.Worksheets(4).Range("I30").Value) Sleep (250) Send ("{ENTER}") EndFunc You see, the file starts out named AsphaltEstimating.xlsm, the script attaches fine now but I later run another script (see below) to save the file into a directory and name the file according to the customers details, after the file is saved, the top script breaks as it is no longer named AsphaltEstimating.xlsm. Func SaveAsphalt() Local $sWorkbook = "C:\Excel\AsphaltEstimating.xlsm" ; Connect to AsphaltEstimating sheet Local $oExcel = _Excel_Open() $oWorkbook = _Excel_BookAttach($sWorkbook) ; Attach to Workbook If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "Something went wrong, start the script over and try again" & @CRLF & "@error = " & @error & ", @extended = " & @extended) $cName = ($oWorkbook.Worksheets(4).Range("J20").Value) ; Customers name $cAddress = ($oWorkbook.Worksheets(4).Range("I30").Value) ; customers address $mFolder = "\\MYCLOUDEX2ULTRA\Bids\2016 Bids\Marks Bids\" & $cName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress $savedNamed = $cName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress $fSave = $mFolder & "\" & $cName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress DirCreate($mFolder) _Excel_BookSaveAs($oWorkbook, $fSave, $xlOpenXMLWorkbookMacroEnabled, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail!", "Error saving workbook to '" & $mFolder & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Success!", "Case file has successfully been saved as '" & $mFolder & "'.") EndFunc Occasionally I have the need to re view the address, so i'm trying to set the top script to be useful regardless of the file name so I have no more hotkeys then currently. I have tried to use WinGetProcess but i'm getting nowhere. Is there an easy way to modify the top script to do what I want or am I looking at a re write?
-
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Ty Ty Ty TY -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Water, This works (I changed some of the naming a bit to make more sense of it in my head), could you tell me if I can refine the code any please and by the way THANK YOU for the help, I greatly appreciate the guidance. Func MakeDirSaveFile() Local $sWorkbook = "C:\Excel\AsphaltEstimating.xlsm" ; Connect to AsphaltEstimating sheet Local $oExcel = _Excel_Open() $oWorkbook = _Excel_BookAttach($sWorkbook) ; Attach to Workbook If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail", "Error Try Again" & @CRLF & "@error = " & @error & ", @extended = " & @extended) $cName = ($oWorkbook.Worksheets(4).Range("J20").Value) ; Customers name $cAddress = ($oWorkbook.Worksheets(4).Range("I30").Value) ; customers address $mFolder = "\\MYCLOUDEX2ULTRA\Bids\2017 Bids\Mark\" & $cName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress $savedNamed = $cName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress $fSave = $mFolder & "\" & $cName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress DirCreate($mFolder) _Excel_BookSaveAs($oWorkbook, $fSave, $xlOpenXMLWorkbookMacroEnabled, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail!", "Error saving workbook to '" & $mFolder & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Success!", "Workbook successfully saved as '" & $mFolder & "'.") EndFunc -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Yes, the post 2 above yours has a screenshot showing the error and just above it shows the actual folder and our cloud address. Mind you, this is a Local cloud, not something like Microsoft Cloud or some other hosting service. -
Found out why this was taking soooo long to save. Changed my code from _Excel_BookSaveAs($oWorkbook, $sFilePath, $xlWorkbookDefault, True) to this _Excel_BookSaveAs($oWorkbook, $sFilePath, $xlOpenXMLWorkbookMacroEnabled, True) now takes even less time then if I manually saved. I noticed that my button macros in my excel files were all broken after returning to a file a few days after making it and researched what Water told me in another post and discovered that the reason it was taking so long to save was that it was changing ever single macro for every button on 70+ pages to all end in xlsx instead of xlsm. So after I change the code I recalled the same buttons and they now function. Example of how they did look vs how they now look Incorrectly named macros 'Reed, Jennifer (Res Seal) 17860 Suzanne Ride Dr Wildwood, MO 63038.xlsx'!Home Correctly named macros 'Reed, Jennifer (Res Seal) 17860 Suzanne Ride Dr Wildwood, MO 63038.xlsm'!Home
-
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
According to a post by Water, Error: -2147352567 (hex: 80020009: DISP_E_EXCEPTION - Unanticipated error occurred) usually means you have no write access to the AD. So I tested the script from 3 different PC's on network, same results. Also, just to eliminate the possibilities. I broke the script into 2 parts. Creating the directory & saving the file. Same results this way too. Do you think it may be an issue with the Western Digital Cloud? I doubt it, but at this point I am willing to consider any possibilities. -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
This is how I altered your version to reflect my scenario Func MakeDirSaveFile() Local $sWorkbook = "C:\Excel\AsphaltEstimating.xlsm" ; Connect to AsphaltEstimating sheet Local $oExcel = _Excel_Open() $oWorkbook = _Excel_BookAttach($sWorkbook) ; Attach to Workbook If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail", "Error Try Again" & @CRLF & "@error = " & @error & ", @extended = " & @extended) $fName = ($oWorkbook.Worksheets(1).Range("J20").Value) ; Customers name $cAddress = ($oWorkbook.Worksheets(1).Range("I30").Value) ; customers address $sPath = "\\MYCLOUDEX2ULTRA\Bids\2017 Bids\Mark\" & $fName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress $sFilePath = $sPath & "\" & $fName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress DirCreate($sPath) _Excel_BookSaveAs($oWorkbook, $sFilePath, $xlWorkbookDefault, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail!", "Error saving workbook to '" & $sFilePath & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Success!", "Workbook successfully saved as '" & $sFilePath & "'.") EndFunc It did create the directory. This is the message returned by the dialog box (see picture attachment) -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Much more eloquent way of saying what I am thinking. That is why I tested the script with a massive Sleep (60000) before asking for help. I suppose I can still use both scripts separately and then just manually move all the files into the folder the script creates, but then that's just conceding. There is a way, I just need to keep at it, though it will likely be clumsy code, lol -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
So the way I use the script to this point is, I enter all the details into the spreadsheet as I always have, once I have adjusted all aspects I then run the _Excel_BookSaveAs (seen below) to archive the customers details. Func SaveAsphalt() Local $sWorkbook = "c:\Excel\AsphaltEstimating.xlsm" ; Connect to AsphaltEstimating sheet Local $oExcel = _Excel_Open() $oWorkbook = _Excel_BookAttach($sWorkbook) ; Attach to Workbook $fName = ($oWorkbook.Worksheets(4).Range("J20").Value) ; Customers name $cAddress = ($oWorkbook.Worksheets(4).Range("I30").Value) ; customers address $sFilePath = "\\MYCLOUDEX2ULTRA\Bids\2016 Bids\Marks Bids\" & $fName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail", "Error Try Again" & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_BookSaveAs($oWorkbook, $sFilePath, $xlWorkbookDefault, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail!", "Error saving workbook to '" & $sFilePath & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Success!", "Workbook successfully saved as '" & $sFilePath & "'.") EndFunc The project we are discussing is my attempt to do exactly the same thing but to organize each customers details per job instead of having a massive pile of excel files jumbled together, regardless of customer or job. After I complete the excel file I also create a PDF version for emailing which also gets named the same. This PDF also gets placed in the folder I create for the particular job I save the excel file for, keeping each case separated. We also place photos taken of each case and/or work order photos into the folder. So as you can see, just saving to a general folder (i.e. \\MYCLOUDEX2ULTRA\Bids\2016 Bids\Marks Bids\) is chaotic. I do not believe at this point that _Excel_Close applies to me. I will keep trying to figure this one out as it's an integral part of the overall project. I'm sure it's something simple we are all just overlooking. -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Hmm, looking at _Excel_Close it seems maybe my approach is all screwed up. Does this mean I should just remove the _Excel_BookSaveAs in my case? very confusing for a beginner, lol I also see this should apply? -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Pretty sure this is how you mean it should be now, same results, makes the directory just fine, but no file present. -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Same thing locally, see pic Water, could you please explain the $ iFormat a bit more. OUr format is in fact xlsm -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
l3ill/Water I appreciate you both helping. Here is a behind the scene look at the spreadsheet to connect some dots. -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
Correct. it Should still be there, but it never is/was. Every time I run it, I have waited different amounts of time to interact with the folder thinking maybe it's a windows thing. It has me baffled. Tho I'm still new to Autoit, so that's easy to do, lol -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
There is no existing file. I am creating the folder and then saving the file into said folder. Both being named identically. -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
I tried putting a very long delay in prior to the _Excel_BookSaveAs of Sleep (60000) hoping it was a delay issue and the same result occurred. -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
This is the error I get and what the current code is getting the error HotKeySet ("^!+{S}", "MakeDirSaveFile") ; Saves the active Excel Asphalt Workbook to server #include <Excel.au3> #include <MsgBoxConstants.au3> While 1 Sleep (50) WEnd Func MakeDirSaveFile() Local $sWorkbook = "c:\Excel\AsphaltEstimating.xlsm" ; Connect to AsphaltEstimating sheet Local $oExcel = _Excel_Open() $oWorkbook = _Excel_BookAttach($sWorkbook) ; Attach to Workbook $fName = ($oWorkbook.Worksheets(4).Range("J20").Value) ; Customers name $cAddress = ($oWorkbook.Worksheets(4).Range("I30").Value) ; customers address $dirName = $fName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress $sFilePath = "\\MYCLOUDEX2ULTRA\Bids\2017 Bids\Mark\" & $fName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail", "Error Try Again" & @CRLF & "@error = " & @error & ", @extended = " & @extended) DirCreate ("\\MYCLOUDEX2ULTRA\Bids\2017 Bids\Mark\" & $fName & " " & "(" & $oWorkbook.ActiveSheet.Name & ")" & " " & $cAddress) Sleep (750) _Excel_BookSaveAs($oWorkbook, $sFilePath, $xlWorkbookDefault, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Fail!", "Error saving workbook to '" & $sFilePath & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Success!", "Workbook successfully saved as '" & $sFilePath & "'.") EndFunc It does however correctly make the directory. -
DirCreate & _Excel_BookSaveAs with Variable
qwiqshot replied to qwiqshot's topic in AutoIt General Help and Support
By the way, I Am trying to create a direct and then save a file into that directory with the exact same name.