How JustAnswer Works:

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

Ask The-PC-Guy Your Own Question

The-PC-Guy
The-PC-Guy, Computer Manager
Category: Microsoft Office
Satisfied Customers: 1259
Experience:  20 years experience providing remote computer support
Type Your Microsoft Office Question Here...
The-PC-Guy is online now
A new question is answered every 9 seconds

Hi, My VBA skills arent great, so bear with me. I have

Resolved Question:

Hi,

My VBA skills aren't great, so bear with me. I have some code pre-provided which brings in data from an API, which I need VBA to display on the worksheet, and split. It is comma delimited data, and it just needs to be displayed in cell H6 of this sheet, and split using the comma as the delimiter.

The pre-provided code is this:



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

Dim buf As String * 16384

Dim stat As Integer
Dim blen As Integer

blen = 16384

stat = GetRace(buf, blen, CDBDE_REFCODE_TABLIMITED, "MR", "1", CDBDE_STATE_TABCORP, CDBDE_POOL_WIN, 10, 0)

If stat CDBDE_COMMAND_COMPLETED Then
MsgBox "An error occurred accessing the Engine, re-initialize"
Else

MsgBox buf

End If
------------------

As you can see, it resolves with a msgbox of the data, when what I really want it to do is display it in cell h6, comma delimited values.

No doubt it's very simple for you guys but as I stated, my programming is limited!!

Thanks for your help
Submitted: 8 months ago.
Category: Microsoft Office
Expert:  Jess M. replied 8 months ago.
Hi, welcome and thank you for your question. My name is XXXXX XXXXX X am glad to assist you today.

Can you send me the copy of the Excel file so that I can test it directly on the file itself? If this is possible, you can upload the file to http://wikisend.com and then give me the download link or the 6-digit File ID.


Please let me know so that I can help you further.

Best regards,
Jess
Customer: replied 8 months ago.


Hi Jess,


 


Sending you the file won't be of any use, because you won't have the data from the API to display, you'll get an error message without the API.

Expert:  Jess M. replied 8 months ago.
Cameron,

No problem. Please tell me the name of the sheet where cell H6 is. Is it named sheet1? Please use this code after the ELSE line at the bottom:

Else

Sheet1.Cells.Range("H6").Text = buf

End If

In this case, replace Sheet1 with the actual name of the sheet where H6 resides.

Please remember to rate my service positively (3-5 stars/faces) once you have all the information you need. Tips are always highly appreciated! Cool

If you have any other questions, please do not rate me negatively. Instead, please ask me or reply to me – I’ll be happy to respond.

Thank you!

Best regards,
Jess
Customer: replied 8 months ago.


Using that code in place of the msgbox code comes up with an error,


 


Run-time error 424:


 


Object required

Expert:  Jess M. replied 8 months ago.
Cameron,

Can you send a copy of the Excel file? I need to know the structure of the entire code. I can just bypass the API connection and results, I just need to test your BUF variable to be displayed on the H6 cell.

Jess
Expert:  The-PC-Guy replied 8 months ago.
Thanks for using JustAnswer. My name isXXXXX will do whatever I can to answer your question

the correct syntax is

ActiveSheet.Cells.Range("H6").Value = buf

let me know if you need anything else
Customer: replied 8 months ago.
Expert:  The-PC-Guy replied 8 months ago.
here is the modified version.

http://wikisend.com/download/281296/testexcel.xlsm


I can't test.

But assuming your api is setting the buf variable to exactly what you want. Then this modified code puts that value in H6 instead of msgbox
Customer: replied 8 months ago.


OK, that's getting there, at least the data is in the cell now, there's just one final part: it needs to be parsed into rows and columns. I've resent the file back with the info in H6, but that info essentially needs to be parsed into a table, or array, separated by it's rows (ie lines) and by the columns, which are comma delimited. I am sure that's easily done in the code also??


 


The updated file is here -


 


http://wikisend.com/download/504048/testexcel.xlsm


 

Expert:  The-PC-Guy replied 8 months ago.
ok, its late where I am, will take a look at it tomorrow.
Expert:  The-PC-Guy replied 8 months ago.
havent been able to test this yet.

But it should do what you want now.

http://wikisend.com/download/313962/testexcel.xlsm


Cool PLEASE REMEMBER TO RATE MY SERVICE SO I GET COMPENSATED FOR MY TIME: Cool

you may do so with the smiley faces underneath this chat window
The-PC-Guy, Computer Manager
Category: Microsoft Office
Satisfied Customers: 1259
Experience: 20 years experience providing remote computer support
The-PC-Guy and 4 other Microsoft Office Specialists are ready to help you
Customer: replied 8 months ago.

That produced an error... but don't worry, I have managed to work it out with the help of someone else in the meantime.

Expert:  The-PC-Guy replied 8 months ago.
ok.

Sorry Since I didn't have the api functions I couldn't test it.

if you need anything else let me know

Cool PLEASE REMEMBER TO RATE MY SERVICE SO I GET COMPENSATED FOR MY TIME: Cool

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 Customer New York
< Last | Next >
  • 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 Customer New 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!!!! Alex Los 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. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, 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. Esther Woodstock, 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. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
< Last | Next >
  • http://ww2.justanswer.com/uploads/JS/jstinehelfer/2012-6-6_215146_Pictureofme1.64x64.png jstinehelfer's Avatar

    jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
  • http://ww2.justanswer.com/uploads/JA/JasonJames122/2011-12-16_135647_jasonjamesheadshotweb.64x64.jpg JasonJames122's Avatar

    JasonJames122

    Computer Enthusiast

    Satisfied Customers:

    0
    I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business
  • http://ww2.justanswer.com/uploads/JE/jessmagz/2012-6-6_18129_jm.64x64.jpg Jess M.'s Avatar

    Jess M.

    Computer Support Specialist

    Satisfied Customers:

    301
    Computer Software Specialist for more than 10 years
  • http://ww2.justanswer.com/uploads/CH/chutz747/2011-11-6_14231_me.64x64.jpg The-PC-Guy's Avatar

    The-PC-Guy

    Computer Manager

    Satisfied Customers:

    274
    20 years experience providing remote computer support
  • http://ww2.justanswer.com/uploads/SP/spherrod/2012-6-6_174244_1000852.64x64.JPG Steve Herrod's Avatar

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    125
    Trained in Microsoft Office from 2000 through to latest version 2010.
  • http://ww2.justanswer.com/uploads/SE/Seashore2011/2011-12-6_33418_111205223015.64x64.jpg Chris L.'s Avatar

    Chris L.

    Support Specialist

    Satisfied Customers:

    124
    Certified Expert with over 10 years experience.
  • http://ww2.justanswer.com/uploads/KR/krkljatorm/2012-6-24_153417_ITMiro.64x64.jpg IT Miro's Avatar

    IT Miro

    Computer Scientist

    Satisfied Customers:

    97
    Bachelor's Degree in Information Technology, Microsoft Certified Professional