Open Filename + SendKeys

M

Matthew

I am writing a macro for Excel in VB. I am opening a .csv file from a
protected part of my web site. I have a dialog box requesting my user name
and password. Excel remembered the values from last time, so all I have to
do is click "OK" or hit enter on the keyboard.

I tried the following script, but it seems to want to finish Open Filename
before going on to SendKeys.

Workbooks.Open Filename:= _
"http://www.osbornewood.com/_private/test.csv"
SendKeys "{ENTER}"

How can I make it go on without waiting for the document to actually open?

Is this the correct general idea, or am I totally on the wrong track?

Matthew
 
C

Cindy Meister -WordMVP-

Hi Matthew,

Try turning it around? Put SendKeys in front of Workbook.Open?
I tried the following script, but it seems to want to finish Open Filename
before going on to SendKeys.

Workbooks.Open Filename:= _
"http://www.osbornewood.com/_private/test.csv"
SendKeys "{ENTER}"

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top