Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default keybd_event versus SendKeys to open Access database with macros disabled

Hi all

I am wanting to programmatically open an Access database with macros
disabled (equivalent to opening with Shift key pressed). I have seen
code for both keybd_event and SendKeys and am wondering what is the
difference. I have heard that SendKeys is a method of 'last resort'.
Can anyone enlighten me?

Thanks in advance

Paul Martin
Melbourne, Australia

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default keybd_event versus SendKeys to open Access database with macros disabled

Most would recommend automation if you actually need to open the Access
application. to do your work. If you just need to work with the data, you
may not need to open access.

Sendkeys simulates typing at the Keyboard. Naturally, how those keystrokes
are interpreted would depend on the environment at the time. I am not sure
on the keybd_event, but would suspect it has something to do with using the
Windows API to stuff keystrokes in the keyboard buffer. The effect would
be the same.

http://support.microsoft.com/?id=167223
OFF97: Microsoft Office 97 Automation Help File Available (Q167223)

http://support.microsoft.com/?id=260410
OFF2000: Microsoft Office 2000 Automation Help File Available (Q260410)

accessing the data directly:
DAO/ADO
http://www.erlandsendata.no/english/...php?t=envbadac

--
Regards,
Tom Ogilvy


"Paul Martin" wrote in message
oups.com...
Hi all

I am wanting to programmatically open an Access database with macros
disabled (equivalent to opening with Shift key pressed). I have seen
code for both keybd_event and SendKeys and am wondering what is the
difference. I have heard that SendKeys is a method of 'last resort'.
Can anyone enlighten me?

Thanks in advance

Paul Martin
Melbourne, Australia



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default keybd_event versus SendKeys to open Access database with macros disabled

Tom

Thanks for the reply. I may write my app in Excel or possibly VB6.
I'm not interested in the data at all. I need to analyse different
components of the .MDB file like system tables, macros, queries, etc
for drive letter paths, use of DSNs and use of non-standard Reference
Libraries (DLLs). If I write the app in Excel, it will write details
to a worksheet. If in VB6, I'll probably write to a text file and open
in Excel.

I am just looking at the best way to open an Access database with
macros disabled, equivalent to pressing the Shift key.

Paul



Tom Ogilvy wrote:
Most would recommend automation if you actually need to open the Access
application. to do your work. If you just need to work with the data, you
may not need to open access.

Sendkeys simulates typing at the Keyboard. Naturally, how those keystrokes
are interpreted would depend on the environment at the time. I am not sure
on the keybd_event, but would suspect it has something to do with using the
Windows API to stuff keystrokes in the keyboard buffer. The effect would
be the same.

http://support.microsoft.com/?id=167223
OFF97: Microsoft Office 97 Automation Help File Available (Q167223)

http://support.microsoft.com/?id=260410
OFF2000: Microsoft Office 2000 Automation Help File Available (Q260410)

accessing the data directly:
DAO/ADO
http://www.erlandsendata.no/english/...php?t=envbadac

--
Regards,
Tom Ogilvy


"Paul Martin" wrote in message
oups.com...
Hi all

I am wanting to programmatically open an Access database with macros
disabled (equivalent to opening with Shift key pressed). I have seen
code for both keybd_event and SendKeys and am wondering what is the
difference. I have heard that SendKeys is a method of 'last resort'.
Can anyone enlighten me?

Thanks in advance

Paul Martin
Melbourne, Australia


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default keybd_event versus SendKeys to open Access database with macros disabled

You might want to post in an access newgroup if you want to know about
Access properties and methods.

Automation would probably be the way to go.

--
Regards,
Tom Ogilvy

"Paul Martin" wrote in message
ups.com...
Tom

Thanks for the reply. I may write my app in Excel or possibly VB6.
I'm not interested in the data at all. I need to analyse different
components of the .MDB file like system tables, macros, queries, etc
for drive letter paths, use of DSNs and use of non-standard Reference
Libraries (DLLs). If I write the app in Excel, it will write details
to a worksheet. If in VB6, I'll probably write to a text file and open
in Excel.

I am just looking at the best way to open an Access database with
macros disabled, equivalent to pressing the Shift key.

Paul



Tom Ogilvy wrote:
Most would recommend automation if you actually need to open the Access
application. to do your work. If you just need to work with the data,
you
may not need to open access.

Sendkeys simulates typing at the Keyboard. Naturally, how those
keystrokes
are interpreted would depend on the environment at the time. I am not
sure
on the keybd_event, but would suspect it has something to do with using
the
Windows API to stuff keystrokes in the keyboard buffer. The effect
would
be the same.

http://support.microsoft.com/?id=167223
OFF97: Microsoft Office 97 Automation Help File Available (Q167223)

http://support.microsoft.com/?id=260410
OFF2000: Microsoft Office 2000 Automation Help File Available (Q260410)

accessing the data directly:
DAO/ADO
http://www.erlandsendata.no/english/...php?t=envbadac

--
Regards,
Tom Ogilvy


"Paul Martin" wrote in message
oups.com...
Hi all

I am wanting to programmatically open an Access database with macros
disabled (equivalent to opening with Shift key pressed). I have seen
code for both keybd_event and SendKeys and am wondering what is the
difference. I have heard that SendKeys is a method of 'last resort'.
Can anyone enlighten me?

Thanks in advance

Paul Martin
Melbourne, Australia




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open a access database using VBA Kryer Excel Programming 2 October 3rd 05 05:14 AM
Open Access Database with VBA Bubba Excel Discussion (Misc queries) 1 July 19th 05 10:53 PM
How to open a spreadsheet with Macros disabled Mauricio Silva Excel Discussion (Misc queries) 6 March 24th 05 01:59 PM
In VBA, Open a file with macros disabled Otto Moehrbach[_6_] Excel Programming 1 October 24th 04 11:44 PM
Excel crashes when attempting to open workbook...even with macros disabled llowwelll[_10_] Excel Programming 1 May 24th 04 09:38 PM


All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"