Microsoft Office

Microsoft Office Questions? Ask a IT Expert for Support ASAP

Ask a Computer Expert,
Get an Answer ASAP!

Microsoft Office
This answer was rated:

I am trying to move to the next step in my projec. When I

I am trying to move...
I am trying to move to the next step in my projec. When I run my macro via batch-vbs, the macro seems to become disabled. I have one test file that will select, a range, then use the sendkeys to sort. My final macro will use the PDFMaker addin with Sendkeys. Read that Add-Ins have to be opened when using an Object to open Excel through VBS. Found some sample code, but cannot figure out how to get it working. Why doesn't test file open, and want to open appropriate add-ins w VBS
Show More
Show Less
Ask Your Own Microsoft Office Question
Answered in 4 minutes by:
8/18/2013
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 39,396
Experience: Over 15 year experience resolving Microsoft Office Issues
Verified
Thank you for requesting me

Can I look at your excel file please?

- Click the following link: http://www.wikisend.com
- Upload the file to that website
- Once it is uploaded, the resulting page will display a "File ID" number.
- Please, give me that "File ID Number"

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

http://wikisend.com/download/398396/test (1).xlsm


 


VBS
Set xl = CreateObject("Excel.application")


xl.Application.Workbooks.Open "C:\sentimenttemplates\test.xlsm"
xl.Application.Visible = True
xl.Application.run "'c:\sentimenttemplates\test.xlsm'!macro1"
'xl.Quit



Set xl = Nothing


 


bat


@echo off


cscript "c:\SentimentTemplates\VBtest.vbs"


 


I have found my macros run ok via auto_exec, but not with the VBS-batch that we developed. This macro1 is my first test which doesn't run. Then, I have another test file, that will pass send keys to use the PDFMAKER addin which is the real macro I want to run. I read that addins are not opened with the object method that we use in the vbs and have some test code for this, but am not sure how to implement. I would like help w/ both these issues, but want to start small with macro1.

You cannot run the Macro from Autoexec, you run it from the VBS script.

So, rename the Sub in the Excel from Autoexec to

public sub sendK()

Then use this code in the VBS (I am assuming you still have it in c:\testt



Set xl = CreateObject("Excel.application")

xl.Application.Workbooks.Open "c:\testt\test.xlsm"
xl.Application.Visible = True
xl.Application.run "'c:\testt\test.xlsm'!sendK"

Set xl = Nothing

It then runs.

Let me know the results please

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

macro1 is not located in the autoexec. It is a stand alone. It just doesn't run properly. Can you run this vbs/bat with text.xlsm to see if it runs for you. It sees to disable.

yes, it will also run correctly (message box Hi)

Use this code in the VBS file.



Set xl = CreateObject("Excel.application")

xl.Application.Workbooks.Open "c:\testt\test.xlsm"
xl.Application.Visible = True
xl.Application.run "'c:\testt\test.xlsm'!Macro1"

Set xl = Nothing

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Wait, the macro we are looking at is Macrotest, not the macro1.


Look at that one

Also works,

Any will work Marilyn, as long as you update the VBS file.

For example, to run MacroTest you put in MacroTest on the second last line

Like below


Set xl = CreateObject("Excel.application")

xl.Application.Workbooks.Open "c:\testt\test.xlsm"
xl.Application.Visible = True
xl.Application.run "'c:\testt\test.xlsm'!MacroTest"

Set xl = Nothing


You see xl.Application.run "'c:\testt\test.xlsm'!MacroTest"

Thats the bit that runs the Macro on open.

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Did you actually run it to verify?


 


The other piece to my question is that I my macro will be using an addin (PDFMaker) . and it said something about addins need to be opened via the vbs code as a step after the Create Object so I needed you to help me with this additional code.


 


This looks like my add-in C:\Program Files (x86)\Adobe\Acrobat 11.0\PDFMaker\Office\PDFMOfficeAddin.dll

Yes I do,

I have run it succesfully every time you have asked.

Why, is it not working for you?


The code you need to enable the Add in for the PDFMaker is

XL.AddIns("Add In Name").Installed = True

You need to replace Add in Name with the name if the Add in.

So your VBS would be

Set xl = CreateObject("Excel.application")

xl.Application.Workbooks.Open "c:\testt\test.xlsm"
xl.Application.Visible = True
XL.AddIns("Add In Name").Installed = True
xl.Application.run "'c:\testt\test.xlsm'!MacroTest"

Set xl = Nothing


Then the Macro can use the Add in.
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Interesting. What version of Excel and Windows are you running this on? Sounds like the first part should work. I wonder why it doesn't.. I've been running this over and over with no luck.


 


In the Addin name, do you think I would put "C:\Program Files (x86)\Adobe\Acrobat 11.0\PDFMaker\Office\PDFMOfficeAddin.dll" in that? Also, have you heard of an addin ending in dll. This is what I saw when I looked in Excel on the PDFMaker addin.

Windows 7 and Excel 2010 but this works on all versions of excel.

Are you using my code for the VBS?

The addin name will be the actual name listed in the adding in Excel.

From what you are saying this looks to be PDFMaker, but check in Addins in Excel to get its name. It is not the DLL name, that is the actual add in file.

Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 39,396
Experience: Over 15 year experience resolving Microsoft Office Issues
Verified
Richard and 87 other Microsoft Office Specialists are ready to help you
Ask your own question now
Customer reply replied 4 years ago

Hum, that is the versions of both that I have. Is there anyway that you can connect to my machine so you can see.


 


I am using the exact code we worked on.


 


I did a google on PDFMaker.xla which does exists. Maybe that could be the one?


Go to Click Me

Click START MEETING

It will download a program to your computer

Run the program by double clicking it, and it will give you a set of 9 numbers

Give me the numbers at the top of the screen (eg: 456-789-123) in your message to me here please

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

507-586-001

Logging on
Ask Your Own Microsoft Office Question
Fixed!
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 39,396
Experience: Over 15 year experience resolving Microsoft Office Issues
Verified
Richard and 87 other Microsoft Office Specialists are ready to help you
Ask your own question now
Ask Richard Your Own Question
Richard
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 39,396
39,396 Satisfied Customers
Experience: Over 15 year experience resolving Microsoft Office Issues

Richard is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

jstinehelfer

jstinehelfer

Information Systems Manager

36 satisfied customers

A+ Comptia Certified computer repair

JasonJames122

JasonJames122

Computer Enthusiast

0 satisfied customers

I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business

Jess M.

Jess M.

Computer Support Specialist

684 satisfied customers

Computer Software Specialist for more than 10 years

The-PC-Guy

The-PC-Guy

Computer Manager

579 satisfied customers

20 years experience providing remote computer support

James K.

James K.

Consultant

260 satisfied customers

Technical Director of IT Company

IT Miro

IT Miro

Computer Scientist

156 satisfied customers

Bachelor's Degree in Information Technology, Microsoft Certified Professional

Chris L.

Chris L.

Support Specialist

143 satisfied customers

Certified Expert with over 10 years experience.

< Previous | Next >

Related Microsoft Office Questions
My Exel 2016 and powerpoint 2016 aren't working and I need
My Exel 2016 and powerpoint 2016 aren't working and I need to get them fixed right away please.… read more
Mr.Med
Mr.Med
893 satisfied customers
I purchased a new HP computer on Oct. 26, 2017. I am not
I purchased a new HP computer on Oct. 26, 2017. I am not happy with it and plan to return it to Walmart in the morning. I have already subscribed to the Microsoft Office. Is it transferable or do I ne… read more
Viet - Computer Tech
Viet - Computer Tech
Computer Technican
Bachelor\u0027s Degree
952 satisfied customers
Justine, Here. I have installed Office 365 Personal but
Hello Justine, Edward Here. I have installed Office 365 Personal but cannot get any of the Items. Need help. … read more
Viet - Computer Tech
Viet - Computer Tech
Computer Technican
Bachelor\u0027s Degree
952 satisfied customers
I have just replaced my failed computer and I am having
I have just replaced my failed computer and I am having trouble loading Windows and getting up and running. I cannot seem to be able to create an account with Microsoft. … read more
Jess M.
Jess M.
Computer Support Specialist
Bachelor's Degree
684 satisfied customers
Just updated my mac software and my outlook 15.1.9 will not
just updated my mac software and my outlook 15.1.9 will not open … read more
Jess M.
Jess M.
Computer Support Specialist
Bachelor's Degree
684 satisfied customers
I have a virus in my excel. Can you help? I have
i have a virus in my excel. Can you help? JA: What's the make and model of your computer? And what version of Excel are you using? Customer: I have streamlining in my letters on my excel JA: Have you … read more
Richard
Richard
Software Specialist
39,396 satisfied customers
How much moneyisneeded to have a Microsoft licence for our
how much moneyisneeded to have a Microsoft licence for our computer? … read more
ChrisC
ChrisC
PC Technician
Associate Degree
659 satisfied customers
I recently upgraded to word 10. I now cannot get my old
I recently upgraded to word 10. I now cannot get my old macros to work … read more
Kris R
Kris R
IT Manager
Computing
2,257 satisfied customers
I have owned microsoft office suite 2013 and recently after
I have owned microsoft office suite 2013 and recently after an malware attack the programme no longer functions - will not open or allow a file to be opened. … read more
Michelle
Michelle
Manager operations
Bachelor\u0027s Degree
1,273 satisfied customers
I recently switched from PC to iMac.I wanted to use Word
I recently switched from PC to iMac.I wanted to use Word instead of Pages so I downloaded an app from the Apple Apps store called Document writer which had a Word icon on it. I have been going crazy a… read more
Jason Jones
Jason Jones
AAS Information Technology
6,316 satisfied customers
I am having trouble e-mailing my excel file to a mail
I am having trouble e-mailing my excel file to a mail recipient. I open the file, use the Quick Access Toolbar to "Send to Mail Recipient" and click send and the words "General mail failure" keep comi… read more
Specialist Sean S.
Specialist Sean S.
Computer Support Technician
673 satisfied customers
I have a Microsoft account but I am still locked out of
I have a Microsoft account but I am still locked out of Microsoft office … read more
Viet - Computer Tech
Viet - Computer Tech
Computer Technican
Bachelor\u0027s Degree
952 satisfied customers
How do you get rid of http:bl163.blu163.mail.live.com/ma
how do you get rid of http:bl163.blu163.mail.live.com/ma from an excel cell … read more
Jess M.
Jess M.
Computer Support Specialist
Bachelor's Degree
684 satisfied customers
I have tried unsuccesfully with Geek Squad to solve this
I have tried unsuccesfully with Geek Squad to solve this problem and I need your help. I cannot connect Outlook with its folders such as "deleted files", Junk files", "sent files", and make them work … read more
caraleneK
caraleneK
Service Manager
1,636 satisfied customers
I am being charged $7.57 per month by Microsoft for
I am being charged $7.57 per month by Microsoft for Microsoft Office 36. I don't use this product and wish to have the charges stopped. How do I get that done? … read more
Kamil Anwar
Kamil Anwar
IT Consultant / Systems Engineer
Bachelor\u0027s Degree
426 satisfied customers
Something is wrong...I am unable to "Send" my message....the
Something is wrong...I am unable to "Send" my message....the option does not appear on my screen as it usually does. … read more
Isaac Franklin
Isaac Franklin
Associate of Science in Social Sciences
837 satisfied customers
I have a document typed in Word 2010. I have Windows 10.
I have a long document typed in Word 2010. I have Windows 10. When I made some changes in the document, the page started to roll up rapidly to the top of the document. I have no idea why. Now I can't … read more
PC_Wizzard
PC_Wizzard
IT Technician
32 satisfied customers
TROUBLE USING THR $ SYMBOLS IN FORULMAS. TO BUILD A CHECK
i AM HAVING TROUBLE USING THR $ SYMBOLS IN FORULMAS. i AM TRYING TO BUILD A CHECK REGISTER. … read more
Richard
Richard
Software Specialist
39,396 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x