3

enter image description hereSo I've got this program that opens a PDF that I want to save. I thought I'd circumvented this SaveAs dialog box using SetPreferences, and yet here's the dialog box again. Anyone have any success getting SetPreferences to turn off the SaveAs dialog?

Am I trying to set these preferences in the wrong place in the program? My understanding was it happens before the bot is started.

Sub CompanyName()

Dim bot As New Selenium.WebDriver

MyFolder = ThisWorkbook.Path
bot.SetPreference "download.default_directory", MyFolder
bot.SetPreference "download.directory_upgrade", True
bot.SetPreference "download.prompt_for_download", False

bot.Start "Chrome", "https://www.intacct.com/ia/acct/login.phtml?[![enter image description here][1]][1]_ga=2.13247287.1007588550.1536894830-1229002215.1536894830"
bot.Get "/"


bot.FindElementById("company").SendKeys "Company ID"
bot.Wait 500
bot.FindElementById("login").SendKeys "Username"
bot.Wait 500
bot.FindElementById("passwd").SendKeys "Password"
bot.Wait 500
bot.FindElementById("retbutton").Click

Stop

'bot.SwitchToParentFrame
Dim menuitem As WebElement
Set menuitem = bot.FindElementByCss("#mainmenu > div > div:nth-child(7) > div.iamenutitlewrapper > span")

bot.Actions.MoveToElement(menuitem).Perform
bot.FindElementByXPath("//span[@class='iamenutitle'][contains(text(),'Accounts Payable')]").Click
bot.FindElementByCss("#mainmenu > div > div:nth-child(7) > div.iamenu.mega.setup-closed > div > div > table > tbody > tr:nth-child(5) > td:nth-child(2) > span:nth-child(2)").Click
bot.SwitchToFrame "iamain"

bot.FindElementByName("F_RECORDID").SendKeys "123"
bot.SendKeys bot.Keys.Enter
bot.Wait 500
bot.FindElementByLinkText("View").Click
bot.Wait 500
bot.FindElementByCss("span.buttons.view_attachment").Click
bot.SwitchToNextWindow
bot.SendKeys bot.Keys.Control, "s"
0m3r
  • 12,286
  • 15
  • 35
  • 71
Sean
  • 71
  • 2
  • 8

1 Answers1

0

The code seems to be ok! Maybe the reason can be the Selenium Driver version. Try to update enr driver on official link here chromedriver.

I hope it helps you. Best Regards, Pedro Azzam.