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
> Intermittent VBA Error When Saving Excel Worksheet As Pdf, Access 2016    
 
   
basson
post Feb 14 2018, 01:48 PM
Post#1



Posts: 873
Joined: 26-March 02
From: St.Louis, MO, USA


Could someone help me understand why I get this error only on occasion?
My VBA code never changes, where and how I run the function never changes. It usually always runs fine as-is but every now and then it stops me with this error as if something has changed or is missing.
I do very little VBA writing, so I am not very familiar with it or what the errors really mean. I tried Googling the error code and message but have not found anything to explain why this usually works but sometimes throws the error.

It is stopping on trying to Save as a PDF. Since I set the sheet to Visible = True, when this occurs I can see the worksheet and manually save as PDF while it is open at this point, so the issue is not something that is keeping it from physically doing the save, yet it will not do it via the code here...but only sometimes.
I have not noticed anything unusual going on with the computer or the file when this occurs so I am not sure what to contribute it to or how to ensure it always works properly.

Attached File  VBERROR.JPG ( 259.03K )Number of downloads: 3



Go to the top of the page
 
ranman256
post Feb 14 2018, 02:04 PM
Post#2



Posts: 883
Joined: 25-April 14



are you ABSOLUTELY sure this folder path exists?
otherwise ,I see no error.
Go to the top of the page
 
basson
post Feb 14 2018, 02:33 PM
Post#3



Posts: 873
Joined: 26-March 02
From: St.Louis, MO, USA


Yes, the directory exists. Been there for a long time and never changed.

So it gave the error this morning, but worked fine this afternoon when I had to rerun the process.

Since you think it looks fine, (thanks for confirming that), the intermittent thing makes me think then maybe some odd network connection issue here at the office, but then I was able to immediately manually save as PDF the same time the error would keep occurring.

Go to the top of the page
 
GroverParkGeorge
post Feb 14 2018, 03:25 PM
Post#4


UA Admin
Posts: 33,945
Joined: 20-June 02
From: Newcastle, WA


THis does sound like a network problem because of the intermittent nature of the error.
Go to the top of the page
 
basson
post Feb 14 2018, 06:28 PM
Post#5



Posts: 873
Joined: 26-March 02
From: St.Louis, MO, USA


The only thing with my network problem theory is that when the VBA module throws the error, I am able to do a manual save as PDF on the open worksheet...When I immediately try to start the VBA again from that point it continues to give me the error even when I can see the network drive is available. It is perplexing.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    17th November 2018 - 03:45 AM