Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Automate Access

My excel file is to close itself after access is called, however the access
file is not opened in full window size. How can I modify the code in order
to have the access window in full size?

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Automate Access

Try:

accessApp.WindowState = -4137

/i.

"hlam" wrote in message news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the

access
file is not opened in full window size. How can I modify the code in

order
to have the access window in full size?

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automate Access

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand acCmdAppMaximize
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub
--
Regards,
Tom Ogilvy



hlam wrote in message news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the

access
file is not opened in full window size. How can I modify the code in

order
to have the access window in full size?





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automate Access

I believe that is the Excel method, but it is not available in Access:

http://support.microsoft.com/default...90&Product=acc
ACC2000: How to Use Visual Basic for Applications to Minimize, Maximize, and
Restore Access

http://support.microsoft.com/default...34&Product=acc
ACC: How to Minimize, Maximize, and Restore MS Access 95/97

At least not in Acc 95 - 2000

--
Regards,
Tom Ogilvy


immanuel wrote in message
...
Try:

accessApp.WindowState = -4137

/i.

"hlam" wrote in message news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the

access
file is not opened in full window size. How can I modify the code in

order
to have the access window in full size?

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Automate Access

Thanks for the correction, Tom. :)

In 2003, it seems that you can just call Appliation.DoCmd.Maximize. Is this
not the case previous versions?

Regards,
Immanuel

"Tom Ogilvy" wrote in message
...
I believe that is the Excel method, but it is not available in Access:

http://support.microsoft.com/default...90&Product=acc
ACC2000: How to Use Visual Basic for Applications to Minimize, Maximize,

and
Restore Access

http://support.microsoft.com/default...34&Product=acc
ACC: How to Minimize, Maximize, and Restore MS Access 95/97

At least not in Acc 95 - 2000

--
Regards,
Tom Ogilvy


immanuel wrote in message
...
Try:

accessApp.WindowState = -4137

/i.

"hlam" wrote in message

news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the

access
file is not opened in full window size. How can I modify the code in

order
to have the access window in full size?

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automate Access

That maximizes the active window within the application window, not the
application window. I understood the requirement to be the application
window. That is the behavior in access 97 and 2000. I don't think it would
change in later versions.

--
Regards,
Tom Ogilvy

immanuel wrote in message
...
Thanks for the correction, Tom. :)

In 2003, it seems that you can just call Appliation.DoCmd.Maximize. Is

this
not the case previous versions?

Regards,
Immanuel

"Tom Ogilvy" wrote in message
...
I believe that is the Excel method, but it is not available in Access:


http://support.microsoft.com/default...90&Product=acc
ACC2000: How to Use Visual Basic for Applications to Minimize, Maximize,

and
Restore Access


http://support.microsoft.com/default...34&Product=acc
ACC: How to Minimize, Maximize, and Restore MS Access 95/97

At least not in Acc 95 - 2000

--
Regards,
Tom Ogilvy


immanuel wrote in message
...
Try:

accessApp.WindowState = -4137

/i.

"hlam" wrote in message

news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the
access
file is not opened in full window size. How can I modify the code

in
order
to have the access window in full size?

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Automate Access

I added the line as you recommended and now I get an error as :

Run-timer error '2501'
The run command action was cancelled.

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand acCmdAppMaximize
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub
--
Regards,
Tom Ogilvy



hlam wrote in message news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the

access
file is not opened in full window size. How can I modify the code in

order
to have the access window in full size?







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automate Access

Didn't notice you were using late binding. Replace the acCmdAppMaximize
constant with it numerical value:

? acCmdAppMaximize
10

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
End With

Set accessApp = Nothing
ThisWorkbook.Close
End Sub

I tested this modified version of this code to keep the db open

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application")

With accessApp
.OpenCurrentDatabase ("C:\My Documents\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
.UserControl = True
End With

' Set accessApp = Nothing
' ThisWorkbook.Close
End Sub


worked fine for me. Access was maximized.

--
Regards,
Tom Ogilvy




hlam wrote in message news:aDCtb.54023$jy.43291@clgrps13...
I added the line as you recommended and now I get an error as :

Run-timer error '2501'
The run command action was cancelled.

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand acCmdAppMaximize
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub
--
Regards,
Tom Ogilvy



hlam wrote in message news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the

access
file is not opened in full window size. How can I modify the code in

order
to have the access window in full size?









  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Automate Access

Thanks for your reply. The access window is now opened in full screen. Now
it's about the startup form that was set to Auto Centre and is now
positioned to the left uppen corner. How can I fix this problem?

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Didn't notice you were using late binding. Replace the acCmdAppMaximize
constant with it numerical value:

? acCmdAppMaximize
10

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
End With

Set accessApp = Nothing
ThisWorkbook.Close
End Sub

I tested this modified version of this code to keep the db open

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application")

With accessApp
.OpenCurrentDatabase ("C:\My Documents\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
.UserControl = True
End With

' Set accessApp = Nothing
' ThisWorkbook.Close
End Sub


worked fine for me. Access was maximized.

--
Regards,
Tom Ogilvy




hlam wrote in message news:aDCtb.54023$jy.43291@clgrps13...
I added the line as you recommended and now I get an error as :

Run-timer error '2501'
The run command action was cancelled.

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand acCmdAppMaximize
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub
--
Regards,
Tom Ogilvy



hlam wrote in message

news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however the
access
file is not opened in full window size. How can I modify the code

in
order
to have the access window in full size?











  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automate Access

Try changing the order of things

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.Visible = True
.DoCmd.RunCommand 10
.OpenCurrentDatabase ("D:\db1.mdb")
End With

Set accessApp = Nothing
ThisWorkbook.Close
End Sub

I would assume the positioning of the open form is handled by Access, so
maximize it before it makes those decisions.

--
Regards,
Tom Ogilvy

hlam wrote in message news:yFDtb.54204$jy.35975@clgrps13...
Thanks for your reply. The access window is now opened in full screen. Now
it's about the startup form that was set to Auto Centre and is now
positioned to the left uppen corner. How can I fix this problem?

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Didn't notice you were using late binding. Replace the acCmdAppMaximize
constant with it numerical value:

? acCmdAppMaximize
10

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
End With

Set accessApp = Nothing
ThisWorkbook.Close
End Sub

I tested this modified version of this code to keep the db open

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application")

With accessApp
.OpenCurrentDatabase ("C:\My Documents\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
.UserControl = True
End With

' Set accessApp = Nothing
' ThisWorkbook.Close
End Sub


worked fine for me. Access was maximized.

--
Regards,
Tom Ogilvy




hlam wrote in message news:aDCtb.54023$jy.43291@clgrps13...
I added the line as you recommended and now I get an error as :

Run-timer error '2501'
The run command action was cancelled.

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand acCmdAppMaximize
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub
--
Regards,
Tom Ogilvy



hlam wrote in message

news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however

the
access
file is not opened in full window size. How can I modify the code

in
order
to have the access window in full size?















  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Automate Access

That works exactly what I expected. Thank you.

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Try changing the order of things

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.Visible = True
.DoCmd.RunCommand 10
.OpenCurrentDatabase ("D:\db1.mdb")
End With

Set accessApp = Nothing
ThisWorkbook.Close
End Sub

I would assume the positioning of the open form is handled by Access, so
maximize it before it makes those decisions.

--
Regards,
Tom Ogilvy

hlam wrote in message news:yFDtb.54204$jy.35975@clgrps13...
Thanks for your reply. The access window is now opened in full screen.

Now
it's about the startup form that was set to Auto Centre and is now
positioned to the left uppen corner. How can I fix this problem?

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Didn't notice you were using late binding. Replace the

acCmdAppMaximize
constant with it numerical value:

? acCmdAppMaximize
10

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
End With

Set accessApp = Nothing
ThisWorkbook.Close
End Sub

I tested this modified version of this code to keep the db open

Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application")

With accessApp
.OpenCurrentDatabase ("C:\My Documents\db1.mdb")
.Visible = True
.DoCmd.RunCommand 10
.UserControl = True
End With

' Set accessApp = Nothing
' ThisWorkbook.Close
End Sub


worked fine for me. Access was maximized.

--
Regards,
Tom Ogilvy




hlam wrote in message

news:aDCtb.54023$jy.43291@clgrps13...
I added the line as you recommended and now I get an error as :

Run-timer error '2501'
The run command action was cancelled.

"Tom Ogilvy" ¼¶¼g©ó¶l¥ó·s»D
...
Sub OpenDatabaseFile()

Dim accessApp As Object

Set accessApp = CreateObject("Access.Application.9")

With accessApp
.OpenCurrentDatabase ("D:\db1.mdb")
.Visible = True
.DoCmd.RunCommand acCmdAppMaximize
End With

Set accessApp = Nothing

ThisWorkbook.Close

End Sub
--
Regards,
Tom Ogilvy



hlam wrote in message

news:DAwtb.52959$jy.12728@clgrps13...
My excel file is to close itself after access is called, however

the
access
file is not opened in full window size. How can I modify the

code
in
order
to have the access window in full size?















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
Query from Access into Excel cause Access to go to read only T Stephens Excel Discussion (Misc queries) 0 March 24th 09 04:17 PM
Can Excel access data from Access?! Al Excel Discussion (Misc queries) 5 April 5th 08 03:52 PM
Access Form In An Access Report (SubForm) Question Gary Links and Linking in Excel 0 January 27th 06 05:54 AM
Automate without add-ins Rob Oldfield Excel Discussion (Misc queries) 3 October 21st 05 07:33 PM
Automate Add-in Gary's Student Excel Discussion (Misc queries) 4 June 20th 05 02:12 AM


All times are GMT +1. The time now is 10:41 AM.

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

About Us

"It's about Microsoft Excel"