UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Change The Size Of Application Window Of Excel From Access Using Vba, Any Version    
 
   
Sami
post Feb 23 2020, 02:35 PM
Post#1



Posts: 97
Joined: 3-April 19



Hi, I try to control the size of Excel window from access I used the followed code after referenced Microsoft Excel (xx),
CODE
Application.WindowState = xlNormal

I tried the CreateObject method but I still need a reference.
Is there any way to have that done without references?
Thanks a lot.
Go to the top of the page
 
cheekybuddha
post Feb 23 2020, 02:50 PM
Post#2


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


Hi Sami,

Go in to Excel. Open the VBA editor and type in the immediate Window:
CODE
?xlNormal

Hit Enter.

Then in your Access code, add:
CODE
Const abnormal As Integer = 123   ' use the number from Excel


Then the code ought to work without a reference.

hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
Sami
post Feb 23 2020, 02:59 PM
Post#3



Posts: 97
Joined: 3-April 19



Amazing
Not only you gave the fish but also taught me the fishing
Thanks again
God bless you.
This post has been edited by Sami: Feb 23 2020, 03:28 PM
Go to the top of the page
 
cheekybuddha
post Feb 23 2020, 03:25 PM
Post#4


UtterAccess Moderator
Posts: 12,620
Joined: 6-December 03
From: Telegraph Hill


Ha ha!

I just noticed my phone changed 'xlNormal' to 'abnormal'!

Hopefully you got the right idea!

--------------------


Regards,

David Marten
Go to the top of the page
 
Sami
post Feb 23 2020, 03:53 PM
Post#5



Posts: 97
Joined: 3-April 19



Yes, I got it from the first time cause it always happens with mine.
Thanks again.
This post has been edited by Sami: Feb 23 2020, 03:54 PM
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    5th April 2020 - 07:58 AM