workbook.save doesn't work properly - vb.net

I'm writing a code to save the changes made to excel file using the button click option.
The code for that is very simple:
workbook.Save()
workbook.Close()
App.close() - this is to close the Excel.Application
However, when I click the button I need to wait a bit and this image appears
I would show the image but due to not having 10 reputation it doesn't let me, so I will explain.
The image form has the title File Now Available and below that in the description it said " 'test4.xlsx is not available for editing. Choose Read-Write to open it for editing "
When I click the cross top right of image the excel file opens and then I have to close that. Once done then I can read that file again.
Is there a way I can write a code whereby that image message doesn't appear and it closes the file properly, as I believe this code doesn't fully close it.
Any help is appreciated
Thank You

Related

PictureBox Missed In the .exe VB.net

I have A pictureBox in a form
I have declared a Picture box called Then
Field.Image = Image.FromFile("C:\Users\ABK\Desktop\Othello\field.png")
Field.Size = New System.Drawing.Size(483, 610)
Then I added the picbox to the form but when i copy the exr into another computer I don't see the picture
when I copy the exe into another computer I cannot see the picture
how can I include it in the exe file
Please try to keep the answers as simple as possible and demonstrate with examples
click on your form.
the properties tab should be on the bottom right
find image or background image and click on it
click the ... on the right side.
image as example of instructions above
a menu should show up.
Click import then select the file you want saved,
then press open it should go back to the menu,
select (none) to set your form image back to normal,
image as example of instructions above
then press ok,
go back to your code and change
Field.Image = Image.FromFile("C:\Users\ABK\Desktop\Othello\field.png")
to Field.Image = My.Resources.field
This should keep the image when you give it to your friend

Button not displayed while running the program

I am using vb.net 2008, I added a button from design view in one of my forms.It shows in the form design view, I gave it the click code to load another form but after I run the program and look in that form, it does not show the button that I added while I run the program. what is the problem? And What are the solutions?
Thanks!
As you can see, I added a Back Button here
THis image is while I run the program. Back button is not displayed here.
I would suggest running something like this in order to see if the control is there. Listing if it is Visible would also be helpful.
https://stackoverflow.com/a/12985464/7340880
Private Sub GetControls()
For Each GroupBoxCntrol As Control In Me.Controls
If TypeOf GroupBoxCntrol Is GroupBox Then
For Each cntrl As Control In GroupBoxCntrol.Controls
'do somethin here
Next
End If
Next
End Sub
The only way I can help you without you providing us more information like code or error info if exist (or maybe a warning), I will suggest you to copy the code from your button then delete the current button and a new one. Then paste the code back to new button.
And make sure you don't hide or change the visible property button somewhere in the code. If you are working with positioning in the code make sure you don't move your button.
Thank you for your support. The problem was that it was running the old .exe file. I deleted the old .exe file from the /bin/debug directory. And after I ran the program, it created me a new .exe file and hence my problem was solved.
Thank you again.

VBA Macro to auto browse and open a file

I am writing a VBA macro to fill a web form with values from spreadsheet.
I have completed macro to fill all form fields except one to click on a button in form to Browse for files.
Below is the macro line to click the browse button.
IE.Document.getElementById("notification_picture").Click
I'm clueless on how to do the next steps i.e. to browse to a particular folder, select and open the file.
Any help is appreciated.
Man... particularly deal with IE is a pain...
You could use
Sendkeys "%S"
It will save it in Downloads folder and then you can move it, open or do whatever you want.
Many will say it is not good to use it because if the user change the focus while the macro is running it will not working, but it is the simplest way.

Exporting a picture or snapshot of a form to Powerpoint from Access 2010

I want to be able to create a loop in Access VBA that basically opens up my form based on a parameter, takes a picture or copies the form somehow and then pastes that image into a Powerpoint deck. The loop would then close the form, get the next parameter to open the same form with new data and do the same operation on the next slide of the Powerpoint deck.
I've googled this and cannot find anything that works for me. Thanks!
REVISION:
Since this seems to be a challenge to accomplish directly within Access, let me ask it another way. I've tried to output the form to a PDF file through VBA
DoCmd.OutputTo acOutputForm, "MYFORM", acFormatPDF, "MYPATH & MYFILENAME"
When I do this in a loop I only get the very last form that opens, as if when Access is sending each form to the PDF file it is overwriting the last one each time. The other problem is that I need to output the form in landscape and I'm not sure how get this to happen in the PDF file. Are there any settings that go with this method or code that would precede or follow it that would allow me to accomplish this? This is alternative because I can then just manually convert the PDF to Powerpoint if I need to.

Excel VBA to change internet explorer advanced settings

My current program that I am using, from excel, navigates to a web page where it downloads a lot of information. I primarily do this from excel because the data is in excel format.
I have it go to the page, click on a link and the open/save/cancel dialog box appears it automatically selects save and saves it to the last folder I saved anything in. Then it waits for the dialog box title to read "download complete" then close it and initiates the next download.
The issue I'm running in to, is that other people who use this program have the "close dialog box when download completes" option selected, and this interrupts the overall process.
Is there a way to change this setting from the excel VBA code, or will I need to explore a different method of dealing with this issue? Having the program do a direct download URL string is also not viable as the website needs to be logged in to and the request must come from the open window, (I have already attempted that method).
Use URLDownloadToFile to download from the internet, trying to use IE will lead to other issues:
VBA - URLDownloadToFile - Data missing in downloaded file