Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access To Excel Form

Posted on 2014-04-20
12
520 Views
Last Modified: 2014-04-22
Hello All,

I think this may be a tough nut to crack but ....i want to open an excel file via access VBA. Now the access vba should be able to access userform2 of that excel workbook and fill one of the textbox.

Is that possible?
VBC or something?

Thank you
0
Comment
Question by:Rayne
  • 7
  • 5
12 Comments
 
LVL 33

Expert Comment

by:Norie
ID: 40011877
I think it might be possible but I have to ask why you want/need to access the Excel userform to fill in a textbox?

What does filling in the textbox do?

Also, in the Access VBA you currently have are you automating Excel?
0
 

Author Comment

by:Rayne
ID: 40011883
ok, so there is a excel workbook that is pass protected.so when users open the workbook, the workbook shows up a userform that requires a pass value. once the user enter in the pass value and hit ok, the workbook filters the data as per the login privilege and then show up the info in sheet1.

That's the excel piece.

For the access  - i have all the data tables stores in he access. And have a custom "refresh" vba button. When  press it, it basically copies the records set from the access table and then  puts in sheet2 on workbook.

now the problem - when the (access) VBA refresh happens, the userform shows up (as it is in the workbook on open event on the worokbook)

so how do i do the access refresh from access vba and not have to worry about facing this pass form...
0
 
LVL 33

Expert Comment

by:Norie
ID: 40011885
How are you opening the Excel workbook?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:Rayne
ID: 40011890
Thank you,

Like this

    Set objXL = New excel.Application
   ' objXL.Visible = True
 
   
    Set wkb = objXL.Workbooks.Open("\fg\wk.xlsm")
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 40011899
If you want to bypass the userform when the workbook opens you could disable events in Excel.
objXL.EnableEvents = False

Open in new window

However I'm not sure that's what you want to do.
0
 

Author Comment

by:Rayne
ID: 40011954
Hello Imnorie,

that works like GOLD,

thank you thank you :)
0
 

Author Comment

by:Rayne
ID: 40011957
Imnorie,

once i do this
objXL.EnableEvents = False

all work....BTW - i am calling a workbook macro from access vba too, at the end. That will work even in this setting?


Thank you
0
 
LVL 33

Expert Comment

by:Norie
ID: 40013565
Disabling events should only affect code that's triggered by an event, for example the Workbook_Open event.

There should be no problem with any other code.

How are you calling the 'workbook' macro?
0
 

Author Comment

by:Rayne
ID: 40013599
thank imnorie,

I am doing this
objXL.run myMacro
0
 
LVL 33

Expert Comment

by:Norie
ID: 40013628
Is 'myMacro' the name of the macro?
0
 

Author Comment

by:Rayne
ID: 40013920
yes imnorie
0
 

Author Closing Comment

by:Rayne
ID: 40014682
Hello Imnorie,

i apologize, i totally forgot you gave me the solution :( already
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question